Smith
Smith

Reputation: 1469

Birt generating different PDF format for the same report

I've a simple report with only one table and paper size set as A4. On the viewer the PDF format is correct but when generated by calling a Java class, the alignment is messed up. It has huge margin in right, tried setting margin to 0, align center... but no luck

Here is the Java code (I'm using Birt 4.4.0)

  PDFRenderOption pdfOptions = new PDFRenderOption();
  pdfOptions.setOutputFormat(RenderOption.OUTPUT_FORMAT_PDF); 
  pdfOptions.setEmitterID(RenderOption.OUTPUT_EMITTERID_PDF);
  pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.FIT_TO_PAGE_SIZE);
  pdfOptions.setOutputStream(response.getOutputStream());

Upvotes: 0

Views: 593

Answers (1)

hvb
hvb

Reputation: 2668

Not sure if this helps, but maybe FIT_TO_PAGE_SIZE is causing your trouble. In my Java program, I'm using these settings instead (and the reports are using a fixed layout):

pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);

// Dafür sorgen, dass Texte nicht abgeschnitten werden, sondern umgebrochen:
pdfOptions.setOption(IPDFRenderOption.PDF_TEXT_WRAPPING, true);
pdfOptions.setOption(IPDFRenderOption.PDF_HYPHENATION, true);

Upvotes: 2

Related Questions