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-26-2017 02:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2017 09:26 AM
does anyone know how to grab the attention of any one in servicenow development team?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2020 03:28 AM
Hi Abd El-Rhman El-Barbary,
I am also trying to generate PDF in landscape. If you did please help me on this.
Thank you in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2018 07:59 AM
Gonna bump this post because I can't seem to set the orientation of the page when generating the PDF. I've examined the plugin and extended it setting the landscape argument to true and it still insists on keeping the PDF in portrait.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 11:07 PM
Hi Abd El-Rhman El-Barbary,
I am also trying to generate PDF in landscape. If you get the solution for customized landscape PDF. Please help me on this.
Thank you in advance