We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDFs created using Print function and Adobe PDF printer (Acrobat Distiller) causing issues

Hi there


We are having issues with PDFs that are created via the Print function for users who are using PowerPoint, Excel or Word 2013 and have Acrobat Professional installed, therefore, having the Adobe Distiller printer driver. See “print to Adobe PDF.png” for screenshot. I also attached the document details for the PDF created, as you can see, it says Acrobat Distiller as the PDF Producer. This doesn’t seem to be happening for other PDFs created in different ways. This also looks to be happening when orientation is selected as Landscape for Excel and for Word files that are converted via the Print method. For Powerpoint, it looks to print by default to Landscape so all PDF files created that way are having the same weird issue.

The header isn’t rendered properly, and the contents of the PDF is cut off.
I’ve attached a console app with sample code for your review. And provided some sample files and the output created for a working PDF and a bad PDF created by Distiller.

PPT converted via create.pdf is a PDF created using Acrobat Pro’s create function.
PPT converted via distiller-print.pdf is a PDF created via the Print to Adobe PDF function.

headerissue.pdf is the PDF created after I attempt to add table with text to the top of the PDF
noheaderissue.pdf should be the expected output.

This is using Aspose.PDF 16.12.

Let me know if you have further questions. This is a critical issue as it is currently occurring in our Production environment.

Hi Abby,


Thanks for your inquiry. We are looking into the issue and will update you soon.

Best Regards,

Hi there

Can you please provide a status update on this issue? It is currently affecting our application in Production.

Thanks

Hello
I have some additional information after debugging further.

The distiller printed PDF I am testing with has the following dimensions
11" x 8.5" (792 x 612) and is a Landscape document. (Width > Height)

However, when I’m looking at the Aspose PDF object, I see that the
doc.Pages(x).PageInfo.Width is 595
doc.Pages(x).Rect.Width is 612
doc.Pages(x).PageInfo.Height is 842
doc.Pages(x).Rect.Height is 792

If I look at
doc.Pages(x).GetPageRect(true).Height and Width, it has the correct Height and Width

See attached screenshot with watches set in Visual Studio using the sample code I provided.
This seems to be only an issue with Distiller created PDF files.
Other types of PDF files return the correct Width and Heights.

Please provide an update to this issue ASAP. This is currently urgently affecting our application in Production.

Hi Abby,


Thanks for your inquriy. I have already noticed the distiller printed PDF is not actual Landscape but has rotation setting of 90 degree. We have logged a ticket PDFNET-42169 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience.

Best Regards,

Thanks, I found on our end that the rotation was set to 90 as well. Can you advise if Aspose is looking at page.GetRect’s dimensions and the rotation to determine where to add Paragraphs? We might need to apply a code workaround to adjust rotation while we wait for the rectification the Aspose side.

Hi Abby,


Thanks for your inquriy. Yes, apparently it seems Aspose.Pdf API is not considering page rotation while adding Paragraphs, but we can confirm you exactly after the issue investigation. Meanwhile, as a workaround you may create PDF document without rotation for your workflow, hopefully it will work. We will keep you updated about resolution progress of above logged issues.

Best Regards,


Hi Tilal

Unfortunately, the workaround you proposed will not be possible as we are processing existing PDFs submitted by our users and appending them together. We need a code workaround to add paragraphs to these existing PDFs created using Distiller that will not distort the content. Additionally, it looks like this issue also occurs when attempting to add a header to the same Distiller created PDFs.

Thanks

Hi Abby,


Thanks for your feedback. We have shared your findings with the product team. We will notify as soon as some update(ETA/findings) is available.

Thanks for your patience and cooperation.

Best Regards,

Hi Abby,


Thanks for your patience.

The development team has shared their feedback regarding the earlier logged issue. You need to rotate page before adding table inside the document, to get expected results. Please check following code snippet, in order to rotate the pages.


foreach (Aspose.Pdf.Page page in doc.Pages) {

Aspose.Pdf.Rectangle rect = page.GetPageRect(true);
page.Rotate = Rotation.None;
Console.WriteLine(“Page {0} width is {1} and heigth is {2}, rotation: {3}, size considering rotation: widht {4} : height {5}”, page.Number, page.Rect.Width, page.Rect.Height, page.Rotate.ToString(), rect.Width, rect.Height);

}


Please try using above approach with Aspose.Pdf for .NET 17.6 and in case you still face any issue, please feel free to contact us.


Best Regards,