Free Support Forum - aspose.com

Printing issues

Hello,

We’re having some regressions with Printing a PDF from the PdfViewer using:

  • Pdf.Kit 3.7.0.0.
  • Aspose.Words 7.0.0.0
  • Aspose.Pdf 4.1.1.0
  1. Printing is removing characters from random areas in the document. Please see all the files in missing_text.zip.
  2. Japanese text is not appearing correctly in printed documents. Please see all the files in japanese_issue.zip.
  3. The margins on printed output are not working correctly. Please compare any of the pdf’s with the xps files.
All of these issues are critical to us as our final code change build is supposed to be tomorrow, so we appreciate you looking into these issues.

Thanks!

Hi John,

I have tested the issue at my end and found no problem with the printed output. Can you please share the code you’re using at your end, so we could test with that as well?

We’re sorry for the inconvenience.
Regards,

We cannot use the Words.Document.SaveToPdf function because it degrades
the quality of our output and does not have full support for Asian fonts. So, we must use the PdfViewer.

Below is the code used. This code has not changed for about 3 versions of our software, except for the PrintDocumentWithSettings function where we now have to explicitly set the page range even if its all pages. Both print calls produce the same result.

PdfViewer viewer;
MemoryStream pdfStream;
Aspose.Pdf.Pdf pdf;

viewer = new PdfViewer();
try
{
pdfStream = new MemoryStream(1 << 17);
pdf = (Aspose.Pdf.Pdf)_result;
pdf.Save(pdfStream);

pdfStream.Position = 0;
viewer.AutoResize = true;
viewer.AutoRotate = true;
viewer.PrintPageDialog = false;
viewer.OpenPdfFile(pdfStream);

if (printerSettings != null)
{
printerSettings.FromPage = 1;
printerSettings.ToPage = viewer.PageCount;
viewer.PrintDocumentWithSettings(printerSettings);
}
else
viewer.PrintDocument();

viewer.ClosePdfFile();

I tested this again and have again attached the output. Please verify that you see the problems in the outputs that I have attached.

I also tried the following variant to the code to correct the doubling of the margins in the printed output and even setting the margins to zero did not work:

printerSettings = new PrinterSettings();

if (printerSettings.PrinterName == “Microsoft XPS Document Writer”)
{
if (!_outputDirectory.Exists)
_outputDirectory.Create();

printerSettings.DefaultPageSettings.Margins = new Margins(0,0,0,0);

printerSettings.PrintToFile = true;
printerSettings.PrintFileName = _outputDirectory.FullName + Path.GetFileNameWithoutExtension(_controller.Package.FileName) + “.xps”;
printerSettings.FromPage = 1;
printerSettings.ToPage = viewer.PageCount;
viewer.PrintDocumentWithSettings(printerSettings);
}

We are coming up on a release date and need to have resolution to these issues. This has been a serious regression from the previous versions of your software that we were using. However, the newer versions contain other critical fixes that were promised to our clients, so we cannot just revert back to the old dll’s.

Thanks for you support in this!

Hello,

Please see the attached zip file for supporting documentation for Issue #3. I have tested with many versions of the Pdf.Kit dll and notice the margin issue is introduced with version 3.6.0.0. I am using Aspose.Pdf.dll 4.1.1.0 for pdf generation. Please see the xps files in the zips, also notice that the Aspose.Pdf.xml that is generated for each version is exactly the same excepting image paths.

Thanks!

Hi John,

I would suggest you to test the issues 1 & 2 with our latest release (Aspose.Pdf.Kit for .NET 3.8). I hope both of these issues will not occur with this version.

As far as issue no. 3 is concerned, I have logged it as PDFKITNET-11543 in our issue tracking system. Our team will be looking into this issue and you’ll be updated via this forum once the issue is resolved.

We’re sorry for the inconvenience.
Regards,



My initial testing with 3.8.0.1 has not been good… When spooling to the printer the Pdf.Kit dll goes into an infinite loop, starts eating memory, and eventually crashes the application. I am going to test on a few different computers/printers to make sure its not something with my setup…

For certain pdf’s the 3.8.0.1 dll crashes, please see the attached zip file for an example.

For my other issues:
1. Cannot test because printing this particular output, a course from our product, causes the application to crash. I have tested with multiple types of this output type. This output type has many Word Shapes inside of a table, so that may have something to do with it
2. This is fixed for our ‘document’ output type to Pdf. However, I cannot test the Course output type to Pdf because printing this output type crashes the application.
3. The extra padding (or doubling of the margins) for the margins still occurs for our document output type to Pdf. I cannot test our Course output type to Pdf.

As of right now the 3.8.0.1 dll cannot be used as it causes an application crash.

Thanks

Hi John,

I have tested this file (index.pdf) using Aspose.Pdf.Kit for .NET 3.8 and was able to print it successfully, without any crash. Can you please share which error message are you receiving? Also share the details regarding your OS/Machine specifications, along with development environment details.

As far as the margin issue is concerned, I have already logged this issue and our team is looking into this matter.

We’re looking forward to help you out.
Regards,