pdf-generation

What is the smallest possible valid PDF?

女生的网名这么多〃 提交于 2019-11-28 17:22:49
Out of simple curiosity, having seen the smallest GIF , what is the smallest possible valid PDF file? This is an interesting problem. Taking it by the book, you can start off with this: %PDF-1.0 1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj 3 0 obj<</Type/Page/MediaBox[0 0 3 3]>>endobj xref 0 4 0000000000 65535 f 0000000010 00000 n 0000000053 00000 n 0000000102 00000 n trailer<</Size 4/Root 1 0 R>> startxref 149 %EOF which is 291 bytes of PDF joy. Acrobat opens it, but it complains somewhat. There is one page in it and it is 3/72" square, the

Generate PDF from HTML PHP

会有一股神秘感。 提交于 2019-11-28 17:06:16
I want to generate PDF from a PHP file that includes HTML controls like textbox, and textarea. I attached CSS in the same. I tried FPDF, DOMPDF and TCPDF, but still I don't get exactly what I want. How do I pass HTML controls with PHP variables and CSS to these libraries? Mark Baker mpdf is another option that you could try. Hardik Thaker EDIT : Found another solution for it, TCPDF is a FLOSS PHP class for generating PDF documents. Looks more dominating library. " PRINCEXML " is a good library (not completely free now). Others: If your meaning is to create a PDF file from PHP , pdflib will

Compare these products for PDF generation with Java given requirements inside: iText, Apache PDFBox or FOP? [closed]

巧了我就是萌 提交于 2019-11-28 16:05:36
There were questions on that but not recently and technology must have gone ahead since then. Requirements: generating pdf documents based on predefined template (I can use either pdf forms or xsl-fo) being able to fill textual data being able to fill graphical data (generated bar codes) being able to alter pdf template in production environment without patching (recompiling) generating pdf file to be saved in the database (as blob) and/or printed open source/free The options assumed are iText, PDFBox, FOP, anything else? What are recommendations based on the requirements above? iText;

Convert PDF to PNG using ImageMagick

时光总嘲笑我的痴心妄想 提交于 2019-11-28 16:02:44
using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -quality 85 a.pdf a.png Looking at what Gmail does when a user "view" a PDF, the quality is awesome and the file size very minimal. The DPI is just 96 (I have to set a density of 300 to get anything decent). Anyone know how GMail does it? Thanks. Avi Pinto when you set the density to 96, doesn't it look good? when i tried it i saw that saving as jpg resulted with better quality, but larger file size

How to dynamically generate a pdf from Google's appengine?

ぐ巨炮叔叔 提交于 2019-11-28 15:09:16
问题 I'd like to create an application that would run on Google's appengine. However, this application needs to be able to generate PDFs dynamically. How could I do this? 回答1: You can use the reportlab library to generate a PDF from Python. You can just include the ReportLab files in with your application's code, or you can include a zip archive of the ReportLab code, and insert it into your application's sys.path . 回答2: To overcome the number-of-files limit in google appengine, you could package

VBA - IE Automation - save as PDF isn't working

假如想象 提交于 2019-11-28 14:42:56
I'm trying to automatically download PDFs from a website (job posting) thanks to a IE automation in VBA and for some reason I don't manage to generate a single PDF. Doing it manualy by going on the web page and doing a 'save target as' on the pdf icon works fine and gives me a valid PDF but the automation fails. I don't understand why and hope someone will be able to give me a hint. Thanks, VeeBee Please find hereafter the code I have so far (the URLs are public and I've picked up offers at random) Private Declare Function DownloadFilefromURL Lib "urlmon" _ Alias "URLDownloadToFileA" _ (ByVal

Header overlap in iText5

陌路散爱 提交于 2019-11-28 13:54:18
I created a header and footer for my PDF document using PdfPTables. I have specified the headers and footers in my PdfPageEventHelper's onStartPage and onEndPage event's respectively. The issue I am facing is while adding a paragraph to my document. When I create a new Paragraph as follows: Paragraph content = new Paragraph("This is a test text"); try{ pdfDocument.add(content); } catch (DocumentException e){ e.printStackTrace(); } The content overlaps with the header. What I need is to set the pargraph between the header and the footer. Can someone tell me what do I need to do in order to put

Does FOP 2.1 support ViewerPreferences?

谁说我不能喝 提交于 2019-11-28 13:54:11
I'm using FOP 2.1 and am trying to set ViewerPreferences, e.g. DisplayDocTitle -> true. I'm trying (from this question <fo:declarations> <pdf:dictionary type="Catalog" xmlns:pdf="http://xmlgraphics.apache/org/fop/extensions/pdf"> <pdf:dictionary type="normal" key="ViewerPreferences"> <pdf:entry key="DisplayDocTitle" type="boolean">true</pdf:entry> </pdf:dictionary> </pdf:dictionary> <x:xmpmeta xmlns:x="adobe:ns:meta/"> ... but getting Jul 13, 2016 11:18:31 AM org.apache.fop.events.LoggingEventListener processEvent WARNING: Unknown formatting object "{http://xmlgraphics.apache/org/fop

Can iTextSharp open an RTF document, manipulate it, and export the document to PDF?

天涯浪子 提交于 2019-11-28 13:36:10
问题 Using iTextSharp (and c#/ASP.NET) is it possible to open an RTF document, manipulate it by replacing some text, insert an image (WMF or PNG), and the export that manipulated document to a PDF document that retains the formatting of the original RTF document? Essentially I'm hoping to create a simple mail merge solution with the template being in RTF and the output needing to be in PDF. This needs to run on an ASP.NET server. 回答1: No it is not possible per se with iTextSharp. Better approach

Generate PDF of only one sheet of my spreadsheet

人走茶凉 提交于 2019-11-28 13:09:56
I need a script that creates a PDF with only one sheet of my spreadsheet. I currently have a script that generates a PDF but does it with the entire file. I can not copy the values to another file, since the sheet I need to export is graphics with data extracted from another sheet. Could you help me? Thank you. function myFunction() { var archivo = SpreadsheetApp.getActive(); var hoja = archivo.getSheetByName("Graficos 2"); var id = archivo.getId(); var archivoId = DriveApp.getFileById(id); var archivoBlob = archivoId.getBlob(); var carpetaId = archivoId.getParents(); var contenidoPDF =