Can no longer produce PDF from Google Sheets spreadsheet for some of the users

I was having this exact problem. After some debugging I saw that my URL was being created incorrectly. My code was nearly identical to yours. Where I found the culprit was the following line: var url_base = theSpreadSheet.getUrl().replace(/edit$/,”); This was not actually clearing out the ‘edit’ to the end of the line like it had … Read more

Unicode in PDF

In the PDF reference in chapter 3, this is what they say about Unicode: Text strings are encoded in either PDFDocEncoding or Unicode character encoding. PDFDocEncoding is a superset of the ISO Latin 1 encoding and is documented in Appendix D. Unicode is described in the Unicode Standard by the Unicode Consortium (see the Bibliography). … Read more

How to implement custom fonts in TCPDF

The latest TCPDF version automatically convert fonts into TCPDF format using the addTTFfont() method. For example: // convert TTF font to TCPDF format and store it on the fonts folder $fontname = TCPDF_FONTS::addTTFfont(‘/path-to-font/FreeSerifItalic.ttf’, ‘TrueTypeUnicode’, ”, 96); // use the font $pdf->SetFont($fontname, ”, 14, ”, false); For further information and examples, please check the TCPDF Fonts … Read more

How can I convert XHTML nested list to pdf with iText?

Please take a look at the example NestedListHtml In this example, I take your code snippet list.html: <ul> <li>First <ol> <li>Second</li> <li>Second</li> </ol> </li> <li>First</li> </ul> And I parse it into an ElementList: // CSS CSSResolver cssResolver = XMLWorkerHelper.getInstance().getDefaultCssResolver(true); // HTML HtmlPipelineContext htmlContext = new HtmlPipelineContext(null); htmlContext.setTagFactory(Tags.getHtmlTagProcessorFactory()); htmlContext.autoBookmark(false); // Pipelines ElementList elements = new ElementList(); … Read more

Export Single Sheet to PDF in Apps Script

Hidden sheets are not included when a spreadsheet is exported via getBlob. So you can temporarily hide any unwanted sheets prior to exporting. function export() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName(‘Unwanted Sheet’); sheet.hideSheet(); DriveApp.createFile(ss.getBlob()); sheet.showSheet(); } The above only hides one sheet, which is enough in the context of your question. Here … Read more

Change PDF title in browser window

Ok, So I found out how to change the meta-data in a .pdf form here: http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7c63.w.html (dead link; archived version here) Sure enough the Title in the Meta Data within the .pdf was “Coury And…” Once I changed this the Tab and the Title in Firefox web browser changed to have the title that I … Read more

Gluing (Imposition) PDF documents

I just came across a nice tool on superuser.com called PDFjam that can do all of the above in a single command: pdfjam –nup 2×1 file1.pdf file2.pdf –outfile DONESKI.pdf It has other standard features like page size plus a nice syntax for more sophisticated collations of pages (the tricky page re-ordering necessary for true booklet-style … Read more