Hi,
I managed to convert a PCL to PDF file. My issue now is that the columns don’t extend the whole page. It looks like while the page is in landscape mode, the text is in portrait mode. I tried to change the columns width after binding the PCL and I tried to set the document page layout with the DOM approach. Both are not working for me.
Can you explain me how the change column width / spacing and fonts after converting PCL to PDF?
Thanks in advance!
Here’s the code I’m using… I attached a converted PCL to PDF file where you can see the issue.
String dataDir = “C:\Mendix\TGKapp-main\deployment\data\tmp\”;
String inputFile = “DJB.R41GN1.SE.PCL5C”;
// APPRAOCH 1 - DOM
// Instantiate LoadOption object using PCL load option
PclLoadOptions loadoptions = new PclLoadOptions();
// Create Document object
Document doc = new Document(dataDir + inputFile, loadoptions);
// Save the resultant PDF document
doc.save(dataDir + “test1-converted.pdf”);
// APPRAOCH 2 - BINDPCL
// Instantiate PDF object
Pdf pdf1 = new Pdf();
// bind the source PCL file with Pdf object
pdf1.bindPCL(dataDir + inputFile);
Sections sections = pdf1.getSections();
Section section0 = sections.get_Item(0);
Section section1 = sections.get_Item(1);
//Set the widths of the columns
section0.getColumnInfo().setColumnWidths(“250 150”);
section1.getColumnInfo().setColumnWidths(“250 150”);
section0.getColumnInfo().setColumnSpacing(“150”);
section1.getColumnInfo().setColumnSpacing(“150”);
FileOutputStream out = new FileOutputStream(new File(dataDir + “test1-converted.pdf”));
pdf1.save(out);