Printing TextStamped PDFs makes printers crash

Hi,

I’m working on an ASP.Net web application where we need to generate PDFs containing a body based on HTML input, plus headers, footers and watermarks. The way we’re currently making these with Aspose is using TextStamps.

The issue is, as soon as there’s a TextStamp in a Document, when our client tries to print the PDF file it makes the printer crash - printing queue blocked and printer basically out of order. It does so for all printers at our client’s site (they’re all the same brand but different models), which is kind of problematic. Our client would also like to share PDF’s with other organizations/individuals and we can’t afford these files to be “dysfunctional”.

A quick fix we found was to check “print as image” in Adobe Reader printing options and then it goes fine. Doing that at each print isn’t a satisfying solution in the long run though, especially considering we have lots of users and it’s difficult to make them all aware of that trick.

  • Has anyone experienced these crashes with overlaid PDF’s ? Is this a known issue, if not with Aspose, with some printer drivers ?

  • Is there any way Aspose can generate PDF’s in image format as this seems to be working when we check that option in Adobe Reader ? I did a little research on that but all I found was how to generate a real image (.jpg, .png) from a PDF document, not converting all of a document to image format and still keep it as a PDF.

Aspose.PDF dll shows 7.6.0.0 as a file version and 2012.12.09 as a product version. We use PdfConformance.PdfA1B. A simplified version of our code is in the file attachment.

Thanks

Help anyone ?

I found another workaround where I save the original PDF as a multi page tiff file and then convert it back into a PDF. Still not satisfactory since I lose all text features + images are smaller than original pages (couldn’t get the ImageScale property to work beyond 1.0)…

GuillaumeL:
The issue is, as soon as there’s a TextStamp in a Document, when our client tries to print the PDF file it makes the printer crash - printing queue blocked and printer basically out of order. It does so for all printers at our client’s site (they’re all the same brand but different models), which is kind of problematic. Our client would also like to share PDF’s with other organizations/individuals and we can’t afford these files to be “dysfunctional”.
Hi Guillaume,

Thanks for using our products and sorry for the delayed response.

Can you please share either you are using PdfViewer class to print the document programmatically or you are trying to print the document using default print options of any third party application. Please note that problem occurs due to structure and complexity of input PDF document. Furthermore, in order to investigate this, we require some documents causing this problem. Please share the documents before stamping and output files generated after stamping the files.

GuillaumeL:
A quick fix we found was to check “print as image” in Adobe Reader printing options and then it goes fine. Doing that at each print isn’t a satisfying solution in the long run though, especially considering we have lots of users and it’s difficult to make them all aware of that trick.
The version of Aspose.Pdf for .NET which you are using is quite old and in recent release versions, we have fixed many issues related to stamping and printing of documents. Can you please try using the latest release of Aspose.Pdf for .NET 8.2.0.

GuillaumeL:

  • Is there any way Aspose can generate PDF’s in image format as this seems to be working when we check that option in Adobe Reader ? I did a little research on that but all I found was how to generate a real image (.jpg, .png) from a PDF document, not converting all of a document to image format and still keep it as a PDF.
Aspose.Pdf for .NET supports the feature to convert PDF pages to Image format and also you can use the same component to convert image files to PDF format. For further information, please visit


GuillaumeL:
Aspose.PDF dll shows 7.6.0.0 as a file version and 2012.12.09 as a product version. We use PdfConformance.PdfA1B. A simplified version of our code is in the file attachment.
I have used the code snippet which you have shared and have created a sample PDF file using Aspose.Pdf.Generator namespace and then I have used TextStamp class to stamp text watermark and once the resultant file is generated, I have used Adobe Reader to view the document and have tried print option of Adobe Reader to print the file. During my testing, I am unable to notice any crash/hang. As suggested earlier, can you please try using the latest release version.

Once again, we are really sorry for this delay and inconvenience.

GuillaumeL:
I found another workaround where I save the original PDF as a multi page tiff file and then convert it back into a PDF. Still not satisfactory since I lose all text features + images are smaller than original pages (couldn't get the ImageScale property to work beyond 1.0)...
Hi Guillaume,

In recent release versions, we have introduced the capability to render text as text object while printing the PDF file using PdfViewer Class and earlier to this enhancement, the text inside PDF pages was being printed as image. Now as a workaround, instead of converting PDF file to TIFF format, I would suggest you to either convert the pages to JPEG or PNG format.

We are sorry for this inconvenience.

Hi Nayyer,

We’re not using PDFViewer, users download the PDF files through the application and can then choose to print them or not using a 3d party application (generally Adobe Reader).

Before providing you with some pre-stamp and post-stamp samples, I’ll try the latest version of Aspose.PDF and let you know if it solved the problem.

Thanks

Guillaume

Turns out it works with version 8.2.0 ! No crashes, which is good news.

The only problem is, the exact same HTML markup is now rendered differently. Particularly, I’ve got text blocks overlapping when they used to follow one another.

Here’s a file containing sample HTML we want to convert to PDF. Everything inside the first tag is now displayed over the contents of the second

. I tried to replace s and s with
s but it didn’t change anything.

The PDF looks really different compared to the HTML as seen in a browser - are there known issues with this in 8.2 ?

Right, I solved the overlapping text problem (oddly enough, a well-placed   in the original HTML did the trick) but then stumbled across font issues. I posted another message here : TextStamp FormattedText font style issue

GuillaumeL:
Turns out it works with version 8.2.0 ! No crashes, which is good news.
Hi Guillaume,

As per my understanding, the issue related to printer crash which occurred when trying to print the document stamped using Aspose.Pdf for .NET is resolved in latest release 8.2.0.

GuillaumeL:
The only problem is, the exact same HTML markup is now rendered differently. Particularly, I’ve got text blocks overlapping when they used to follow one another.

Here’s a file containing sample HTML we want to convert to PDF. Everything inside the first tag is now displayed over the contents of the second

. I tried to replace s and s with
s but it didn’t change anything.

The PDF looks really different compared to the HTML as seen in a browser - are there known issues with this in 8.2 ?

As per your comments over 481591, the problem is resolved by updating the source PDF file. However I am working over the issue which you have reported over 481586.

Correct. Thanks Nayyer.