Hello,
we currently run into printing issues (evaluated with callas pdfToolbox - digital print (b/w)) in combination with aspose.pdf 3.3 for java. Apparantly, there is some content inserted with 0pt fontsize in every generated pdf leading to problems in the post processing.
I have attached a demo pdf file (Test.pdf) and a screenshot from the output of the callas evaluation (Test_eval.png, blue cross). If a pdf is created without any content the occuring invisible ‘dot’ is associated with the defined default font size (e.g. 12pt). I have also attached pdf and evaluation result for this case. Is there any possibility to avoid this kind of embedded content or at least to avoid occurence of 0pt fontsize content?
Thanks in advance!
Andreas
Hi Andreas,
Hi,
I finally figured out that the reason for the observed behaviour was the fact that I only put content inside a footer element. Therefore the “default” section remained empty. A simple workaround for me was to add a blank text to the first section.
Here is a code snippet which should reproduce the problem:
Pdf pdf = new Pdf();
// not essential to show behaviour
pdf.setIsCoreFontUsed(false);
pdf.setDefaultFontName(“Times New Roman”);
pdf.getTextInfo().setFontSize(12);
Section sec = pdf.getSections().add();
//add this line to overcome the problem
//sec.getParagraphs().add(new Text(sec, “”));
HeaderFooter hf = new HeaderFooter(sec);
Text t = new Text(hf, “Test TEXT”);
hf.getParagraphs().add(t);
sec.setOddFooter(hf);
pdf.save(“Test.pdf”);
I guess it seems quite uncommon but in my case it’s necessary to put only content inside the footer section…
Kind regards,
Andreas
Hi Andreas,
//create a PdfViewer class instance.<o:p></o:p>
PdfViewer pdfviewer = new PdfViewer();
//open a Pdf file.
pdfviewer.openPdfFile("c:/pdftest/Test (1).pdf");
//set the Pdf file page parameters, the first 1 = 100%, the second 1 is the Pdf page number.
pdfviewer.setPdfPageParameters(1, 1);
//If you want to print the Pdf file, the follow code is an example. The SimplePdfViewer shows the usage in detail.
//sets the default print scale - false.
pdfviewer.enableScalePrint(false);
//gets a printjob object.
PrinterJob printJob = PrinterJob.getPrinterJob();
//gets the default page.
PageFormat pf = printJob.defaultPage();
//sets the Paper object for this PageFormat.
// pf.setPaper(paper);
//allows user to edit settings and select printing
printJob.setPrintable(pdfviewer, pf);
//creates the printDialog.
boolean printFile = printJob.printDialog();
if (printFile)
{
printJob.print();
}
//close the Pdf file.
pdfviewer.closePdfFile();
Hi,
direct printing isn’t really the problem, I’m sorry if I wasn’t clear enough. The problem occurs in our pdf postprocessing by the application of a preflight check, which leads to an error due to the stated text section with 0pt font size.
I used callas pdfToolbox to visualize the problem to you. As mentioned above, the workaround is fine for me in the moment.
Kind regards,
Andreas
Hi Andreas,