pdf-generation

TextPosition Bounding Box PDFBox

帅比萌擦擦* 提交于 2019-12-24 03:41:55
问题 I am trying, from a TextPosition, to draw the corresponding glyph bounding box as shown in the PDF 32000 documentation. Here is my function that does the computation from glyph space to user space @Override protected void processTextPosition(TextPosition text) { PDFont font = pos.getFont(); BoundingBox bbox = font.getBoundingBox(); Rectangle2D.Float rect = new Rectangle2D.Float(bbox.getLowerLeftX(), bbox.getUpperRightY(), bbox.getWidth(), bbox.getHeight()); AffineTransform at = pos

Metadata in PDF Files

荒凉一梦 提交于 2019-12-24 03:02:42
问题 I want to be able to store some plugin-specific data in a PDF so that I can read it back when that PDF is loaded back, without this metadata being visible to the user. How can I put this metadata into the PDF File? 回答1: PDF supports XMP metadata. You should append your plug-in specific information as a payload in the XMP portion. 回答2: Depending on how you are generating and reading your PDFs you can use pdftk to edit your metadata. You can add an invisable tag to the PDF by adding it as a

Cannot use border-radius CSS3 property with Flying Saucer

荒凉一梦 提交于 2019-12-24 02:33:08
问题 I am working on a project where I need to convert an HTML to a PDF. I am using Flying Saucer 9.1.6 from Maven Central for this. The subjacent PDF generation library is IText 2.1.7 . Although Flying Saucer Git repo states that it supports CSS3 border-radius syntax I am unable to achieve rounded corners with border-radius. Here is the sample code ITextRenderer pdfRenderer = new ITextRenderer(); String resumeHTML = "<html>\n" + "<head>\n" + " <title>JS Bin</title>\n" + " <style>\n" + " .circle{

How to avoid the “too deeply nested” error when creating PDFs with Sphinx?

自古美人都是妖i 提交于 2019-12-24 02:18:57
问题 I have a fairly complex project with a fairly large documentation. Converting the normal user guide to PDF with Sphinx via make latexpdf works quite well. However, if I also want to include the library reference with all function, class, and module documentations, the command fails with: ! LaTeX Error: Too deeply nested. Manually reducing the nesting is not an option. Sphinx internally nests parameter descriptions, function descriptions, module descriptions and whatnot. So figuring out in

Generate PDF with XSL-FO for Android

好久不见. 提交于 2019-12-24 02:11:50
问题 Is it possible to generate a PDF in an Android application using XSL-FO? 回答1: Download Apache FOP and see if the required dependencies are includes in Android's runtime. It might be rather slow. You could use iText or PDFBox to render PDF - or use a server and let Android just request a PDF creation. 来源: https://stackoverflow.com/questions/9393679/generate-pdf-with-xsl-fo-for-android

Creating PDF document from Word document using java api

久未见 提交于 2019-12-24 00:58:49
问题 In one of my requirement I have to create a PDF from word document such that 1) There will be a page number on every page. 2) There will be line number for every line, starting from line no as 1 for each page. Our application is written in java so Java API will be more helpful. But if it is more convenient in any other language that will be OK. 回答1: Here is a link to the most common Java PDF API :) http://java-source.net/open-source/pdf-libraries IText is the most famous one, This is the link

Puppeteer custom header footer for PDF render

拜拜、爱过 提交于 2019-12-24 00:21:11
问题 I am working on rendering a PDF of a site. I want different headers and footers for the first page and different for the rest of the pages. Is there any way to do this? const puppeteer = require('puppeteer'); (async() => { var t = Date.now(); console.log('Current time ' + t + ' msec'); const browser = await puppeteer.launch({executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', ignoreHTTPSErrors:true, headless:true, devtools:false}); const page = await browser

Matplotlib PDF backend slow?

守給你的承諾、 提交于 2019-12-23 19:47:36
问题 I'm writing a thousand plots to a PDF using matplotlib. I've already optimized the plotting code, ie. reusing figures/axes/lines and just changing the y data. The bulk of the remaining time is spent in save_figure. R, in comparison, seems to output a plot to PDF about 2x faster. Plots will all zero data seem to be even faster in R, while they're the same speed in Python. I've set pdf.compression = 0, which makes a small improvement. Tried rasterizing the data, it made no difference to

PHPExcel create/style/save PDF Documentation

浪尽此生 提交于 2019-12-23 19:14:45
问题 I'm using the PHPExcel library in a couple of project and love the functionality it provides. Currently I needed to save as a PDF and found that PHPExcel can do this but I'm finding it rather hard to track down some examples or documentation on the process. Here are the links I have found: http://phpexcel.codeplex.com/wikipage?title=News%20archive http://www.devshed.com/c/a/PHP/PHP-Excel-Working-with-Workbook-and-PDF-Files/1/ Follow up question: I need the PDF to look and function as a form,

Adding Rich Text to an AcroField in iTextSharp

余生颓废 提交于 2019-12-23 18:37:33
问题 I need to add some formatted text to a PDF form field using iTextSharp and I can't seem to figure it out. This is how I'm currently setting the fields, but certain portions of the inserted text will need to be bold or have other formatting. stamper.AcroFields.SetField("fieldName", "fieldValue") stamper.FormFlattening = True I've seen elsewhere that I should be able to insert some xml that includes formatting information instead, but I have no idea what this xml should look like. Here's the