Questions tagged [pdf-generation]

PDF generation is the process of creating a PDF document using various tools or libraries.

Use this tag for any programming-related question concerning the creation of PDF files, be it with a 3rd-party library or tools like PDF printers or PDF converters, or PDF authoring applications.

Questions asking us to recommend or find a tool, library or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam.

Related tags: ,

7433 questions
1721
votes
30 answers

How Can I add HTML And CSS Into PDF

I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to style it and renders fine in HTML. I'm now after a way of converting it to PDF. I have tried: DOMPDF: it had huge problems with tables. I…
cletus
  • 616,129
  • 168
  • 910
  • 942
317
votes
7 answers

Generating PDF files with JavaScript

I’m trying to convert XML data into PDF files from a web page and I was hoping I could do this entirely within JavaScript. I need to be able to draw text, images and simple shapes. I would love to be able to do this entirely in the browser.
amoeba
  • 4,015
  • 3
  • 21
  • 14
188
votes
3 answers

Best C# API to create PDF

Can you recomend any PDF API for C#. Free is the best, but I don't mind paying for it.
Sven
  • 1,935
  • 2
  • 13
  • 7
184
votes
10 answers

What is the smallest possible valid PDF?

Out of simple curiosity, having seen the smallest GIF, what is the smallest possible valid PDF file?
meshy
  • 8,470
  • 9
  • 51
  • 73
140
votes
8 answers

Converting HTML files to PDF

I need to automatically generate a PDF file from an exisiting (X)HTML-document. The input files (reports) use a rather simple, table-based layout, so support for really fancy JavaScript/CSS stuff is probably not needed. As I am used to working in…
panschk
  • 3,228
  • 3
  • 24
  • 20
131
votes
10 answers

Render HTML to PDF in Django site

For my django powered site, I am looking for an easy solution to convert dynamic html pages to pdf. Pages include HTML and charts from Google visualization API (which is javascript based, yet including those graphs is a must).
crib
127
votes
5 answers

What are the minimum margins most printers can handle?

Im creating pdfs server side with lots of graphics so maximizing real estate is a must but at the same time ensuring users printers can handle the tight margins is a must. Does anyone have an idea what safe values I can use for the margins when…
robodisco
  • 4,162
  • 7
  • 34
  • 48
118
votes
4 answers

Convert PDF to PNG using ImageMagick

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…
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
116
votes
15 answers

Puppeteer wait until page is completely loaded

I am working on creating PDF from web page. The application on which I am working is single page application. I tried many options and suggestion on https://github.com/GoogleChrome/puppeteer/issues/1412 But it is not working const browser =…
115
votes
9 answers

Which one is the best PDF-API for PHP?

Which one of these is the best PDF-API for PHP? ApacheFOP dompdf FPDF html2ps mPDF PDFlib TCPDF wkhtmltopdf Zend_Pdf
coderex
  • 27,225
  • 45
  • 116
  • 170
91
votes
17 answers

HTML to PDF with Node.js

I'm looking to create a printable pdf version of my website webpages. Something like express.render() only render the page as pdf Does anyone know a node module that does that ? If not, how would you go about implementing one ? I've seen some…
Michael
  • 22,196
  • 33
  • 132
  • 187
87
votes
4 answers

Python PDF library

What Python PDF libraries are there? I need to make some PDF with many grids, and I'm looking for a library that allows to manage pages (multi-page). The library should calculate when the page is ended and then create the next page.
enfix
  • 6,680
  • 12
  • 55
  • 80
84
votes
5 answers

ITextSharp insert text to an existing pdf

The title sums it all. I want to add a text to an existing PDF file using iTextSharp, however i can't find how to do it anywhere in the web... PS: I cannot use PDF forms.
Tony
  • 2,473
  • 3
  • 23
  • 32
79
votes
4 answers

iOS SDK - Programmatically generate a PDF file

Using the CoreGraphics framework is tedious work, in my honest opinion, when it comes to programmatically drawing a PDF file. I would like to programmatically create a PDF, using various objects from views throughout my app. I am interested to know…
WrightsCS
  • 50,551
  • 22
  • 134
  • 186
78
votes
3 answers

how to save DOMPDF generated content to file?

I am using Dompdf to create PDF file but I don't know why it doesn't save the created PDF to server. Any ideas? require_once("./pdf/dompdf_config.inc.php"); $html = ''. '

Put your html here, or generate it with your…

TomTom
  • 1,113
  • 1
  • 10
  • 20
1
2 3
99 100