Customized Landscape PDF files using 'GeneralPDF' script include

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 01:43 PM
Hi Community,
I've found a way here in the community that utilizes a script include called 'GeneralPDF' to create custom PDF files on the server side, typically the code looks like this:
var emptyPDFDoc = new GeneralPDF.Document(null, null, null, null, null, null); var pdfFile = new GeneralPDF(emptyPDFDoc); pdfFile.startHTMLParser(); pdfFile.addHTML("some html"); pdfFile.stopHTMLParser(); |
---|
This is working fine for me, the only thing is that I want to generate the PDF as landscape and I can't, I know that it's possible because the original library looks like this:
As you can see, there is a parameter 'landscape', I've tried passing true but it does not work, any ideas? since the library is utilizing iText at the end I guess it will be sth related to the page size object (new iTextPDFUtil.PageSize()), note that I can extend this library abd write my own version of it in case we need any changes to the core
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 04:30 PM
Please refer UI action code below which generate PDF in landscape format.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2017 01:09 AM
thanks for your reply but this is totally another way for doing the whole thing, what I'm interested in here is to customize the class 'GeneralPDF' (in the screenshot) somehow to enable landscape generation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2017 07:55 AM
It's not best practice to customize OOB objects since these objects will be skipped during future upgrades.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2017 09:08 AM
my bad you got it wrong, by customizing I mean 'passing the correct parameters' not editing the file, do you have any ideas regarding this?