Print to PDF Error

Hi @lubos
I am getting this error whenever I try to print to PDF using the PDF button

DocumentSaveException: Apitron.PDF.Kit.ErrorHandling.DocumentSaveException: Exception of type ‘Apitron.PDF.Kit.ErrorHandling.DocumentSaveException’ was thrown.
at Apitron.PDF.Kit.FlowDocument.Write (System.IO.Stream outputStream, Apitron.PDF.Kit.FixedLayout.Resources.ResourceManager resourceManager, Apitron.PDF.Kit.FixedLayout.PageProperties.PageBoundary boundary, Apitron.PDF.Kit.PdfStandard pdfStandard) [0x0008c] in <728adfd22f494302abfb7751894c81e5>:0
at ManagerServer.Extensions.PdfConverter.ConvertHtmlToPdf (System.String input, System.IO.Stream output, Apitron.PDF.Kit.FixedLayout.PageProperties.PageBoundary pageBoundary) [0x004e6] in :0
at ManagerServer.HttpHandlers.UserHandlers.Pdf.Post () [0x00136] in :0

Im using Manager 17.5.0 on Mac OS Sierra

You need to clarify you comment. You wrote “print to PDF using the PDF button.” Are you:

  1. Generating a PDF with the PDF button and trying to print that? If so, are you actually printing that PDF or using the macOS Print dialog to save a PDF of it? (A PDF of a PDF)

  2. Clicking the Print button in Manager and selecting the Save as PDF option in the macOS Print dialog box?

I’ve just tried all these options with the same version of Manager on macOS v10.12.5. and have no trouble. Your forum history reveals you’ve had printing/PDF problems before with Windows 7. Have you just switched to Mac? Or did you switch some while ago and only just now encounter this problem? If you just encountered it after a period of successful usage, what changed?

Hi @Tut,

I understand there is a difference between using the “PDF” button and the " Print" button on Manager.
I prefer to use the “PDF” button since it is able to split longer documents into separate pages with the headers on each page ( i.e. Name, Logo and Address ) This always helps to make the documents more readable and organized especially when printed to paper. I appreciate this feature, good work.
I am trying to generate a PDF by clicking the “PDF” button on Manager, not the " Print " button.
The process fails even before I am presented with the document in a separate Preview window on Mac, as it usually would.
I have noticed that this happens only with particular documents. I’m still trying to figure it out, but so far it seems that it happens when a document contains special characters, or when the description section for an item is long.
The “PDF” function seems to throw an error when trying to compile the Invoice/ Sales Quote into a PDF.
I copy/pasted the error onto my first post above.
It seems to go away and work once I remove some of the items from the list.

Please advice.

My previous issue on Windows 7 was, as I later found out, the change Adobe made to the Print to PDF plugin that used to come with the free version of Adobe Reader. It was resolved when I decided to switch to Mac, since the PDF plugin is included in the OS, I guess.

You explanation is helpful, @adam. But until some of us can duplicate the problem, @lubos won’t be able to fix it. One thing you wrote was especially important: special characters. Can you identify which characters? The PDF generator uses the Google Noto fonts, specifically to avoid this type of problem, but it may not be perfect. If you can pin down which characters cause problems, it can probably be fixed.

You also mentioned a Description being long. Can you determine how long it must be to cause the problem? I’ve done some lengthy ones without trouble.

584357​⁠​

Hi @Tut,

Try and copy paste the above number into the " Billing Address" field of any of the quotes.

OK, I can reproduce the problem by copying and pasting exactly what you posted. And it shows up not just in quotes, but also in sales invoices, sales orders, and delivery notes. (It doesn’t happen in credit notes, but that’s because the billing address field doesn’t update at all. That’s a different bug.)

The problem lies in your “7” character. Somehow, it’s corrupted. If you type the exact same number directly into the billing address field, the PDF function works. You may also notice strange behavior if you try to edit that “7”. It resists being selected or deleted in funny ways.