Extremely large Postscript files with semitransparent areas

Hi!


While testing Aspose.PDF 8.3.1.0 for a reprint scenario, I encountered the following problem: When converting a pdf, which was created from a Postscript document with semitransparent areas, back to Postscript, the resulting file becomes extremely large. In my test case, a pdf with 68 KB (containing a single shape and one line of text) resulted in a Postscript file with about 146 MB(!).

As a comparison, when I print the very same PDF to a file using Adobe Acrobat, the resulting file is about 6 MB in size. Although this is still significantly larger than the PDF, the Postscript can at least be printed or viewed in acceptable time.

I have attached an example pdf file used in the test case described. The following code is used for the conversion:

using (var viewer = new PdfViewer())
{
viewer.BindPdf (pdfStream);

viewer.PrintPageDialog = false;
viewer.AutoResize = true;

var printerSettings = new PrinterSettings { PrintFileName = postscriptOutputFilePath, PrintToFile = true, PrinterName = PrinterName };

var pageSettings = GetPageSettings (pageSize);

viewer.PrintDocumentWithSettings (pageSettings, printerSettings);
viewer.Close();
}

private static PageSettings GetPageSettings (PageSize pageSize)
{
var width = UnitUtility.GetHundrithOfInchFromTenthOfMillimeter (pageSize.WidthInTenthOfAMillimeter);
var height = UnitUtility.GetHundrithOfInchFromTenthOfMillimeter (pageSize.HeightInTenthOfAMillimeter);

return new PageSettings
{
PaperSize = new PaperSize (“PaperSize”, (int) Math.Round (width), (int) Math.Round (height)),
Margins = new Margins (0, 0, 0, 0)
};
}

Best regards,
Thomas

Hi Thomas,


Thanks for you inquiry. I’m afraid your source document is missing, can you please share it again.

We are sorry for the inconvenience caused.

Best Regards,

Hi Tilal,


I have attached the missing document, sorry for the inconvenience.

Best regards,
Thomas

Hi Thomas,

Thanks for sharing source document. While testing the scenario using Aspose.Pdf for NET 8.4.0, I've observed the size issue of Postscript file and logged the issue in our bug tracking system as PDFNEWNET-35790 for further investigation and resolution. I've also linked your request to this issue and you will be notified via this thread as soon as it is resolved.

We are sorry for the inconvenience faced.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Best Regards

The issues you have found earlier (filed as PDFNEWNET-35790) have been fixed in Aspose.Pdf for .NET 8.8.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi!


Using Aspose.Pdf 8.8.0 I can still reproduce the issue with the attached document: a 146 MB Postscript file is created.

Is there any new option in 8.8.0 related to the conversion that I need to use? Otherwise, I would kindly ask you to reopen the issue as we still need a fix for this.

Best regards,
Thomas

Hi Thomas,


Thanks for your inquiry. After further investigation we have found that results vary on different postscritpt printers. Using following code and postscript printer HP LaserJet 5200L PS we obtained the file with size 851Kb . So testing on different postscript printers gives not the same results.

const string myDir = @“c:”;<o:p></o:p>

using (PdfViewer viewer = new PdfViewer())

{

viewer.RenderingOptions.SystemFontsNativeRendering = true;

viewer.BindPdf(myDir + "TransparentShape.pdf");

viewer.AutoResize = true;

viewer.AutoRotate = true;

viewer.PrintPageDialog = false;

System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();

ps.PrintFileName = myDir + "TransparentShape.ps";

ps.PrintToFile = true;

ps.PrinterName = "HP LaserJet 5200L PS";

PageSettings pgs = new PageSettings();

pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);

viewer.PrintDocumentWithSettings(pgs, ps);

viewer.Close();

}

Please feel free to contact us for any further assistance.


Best Regards,