Get rid of the white space around matlab figure’s pdf output

Exporting Figures for Publication is a good starting point. Instead of -deps use -dpdf for pdf output. You can fix the bounding box issue using the code below. set(gcf, ‘PaperSize’, [6.25 7.5]); set(gcf, ‘PaperPositionMode’, ‘manual’); set(gcf, ‘PaperPosition’, [0 0 6.25 7.5]); set(gcf, ‘PaperUnits’, ‘inches’); set(gcf, ‘PaperSize’, [6.25 7.5]); set(gcf, ‘PaperPositionMode’, ‘manual’); set(gcf, ‘PaperPosition’, [0 0 … Read more

How to determine artificial bold style ,artificial italic style and artificial outline style of a text using PDFBOX

The general procedure and a PDFBox issue In theory one should start this by deriving a class from PDFTextStripper and overriding its method: /** * Write a Java string to the output stream. The default implementation will ignore the <code>textPositions</code> * and just calls {@link #writeString(String)}. * * @param text The text to write to … Read more

Checking off pdf checkbox with itextsharp

You shouldn’t “guess” for the possible values. You need to use a value that is stored in the PDF. Try the CheckBoxValues example to find these possible values: public String getCheckboxValue(String src, String name) throws IOException { PdfReader reader = new PdfReader(SRC); AcroFields fields = reader.getAcroFields(); // CP_1 is the name of a check box … Read more

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