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
38
votes
4 answers

jsPDF can't get any styling to work

I'm new to using jsPDF but and for the life of me I can't get any css to apply to this thing! I've tried inline, internal, and external all to no avail! I read in another SO post that since it's technically printing stuff to a file I need a print…
samuraiseoul
  • 2,888
  • 9
  • 45
  • 65
37
votes
6 answers

Internal links in rmarkdown don't work

I use rmarkdown to render pdf documents. Now I want to add internal links in the texts. In the helping pages of rmarkdown, it says an internal link is defined as: See the [Introduction](#introduction). When I Use e.g. the next code there should be…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
37
votes
6 answers

Changing or eliminating Header & Footer in TCPDF

AddPage() in tcpdf automatically calls Header and Footer. How do I eliminate/override this?
ChuckO
  • 2,543
  • 6
  • 34
  • 41
37
votes
8 answers

Unicode in PDF

My program generates relatively simple PDF documents on request, but I'm having trouble with unicode characters, like kanji or odd math symbols. To write a normal string in PDF, you place it in brackets: (something) There is also the option to…
Marcus Downing
  • 10,054
  • 10
  • 63
  • 85
36
votes
3 answers

Save multiple sheets to .pdf

I have a reporting spreadsheet that grabs some data from a database and forms three sheets of summary report information. I want to run the spreadsheet automatically from the command line, and have it automatically save all three reporting sheets as…
guthrie
  • 4,529
  • 4
  • 26
  • 31
35
votes
7 answers

django - pisa : adding images to PDF output

I'm using a standard example from the web (http://www.20seven.org/journal/2008/11/pdf-generation-with-pisa-in-django.html) to convert a django view / template into a PDF. Is there an "easy" way to include images (either from a url or a reference on…
jduncan
  • 677
  • 2
  • 12
  • 22
35
votes
3 answers

How to calculate width and height of text in jspdf?

I'm facing some issues while creating tables in jspdf. I could not find any good related docs, but if anyone knows one, please share. I found two related methods: 1) doc.getStringUnitWidth(text, {widths:12,kerning:2}); 2)…
NFE
  • 1,147
  • 1
  • 9
  • 22
34
votes
1 answer

How can I create a customized version of an existing pdf file with node.js?

I have an old system that was written in PHP a long time ago that I would like to update to node.js to allow me to share code with a more modern system. Unfortunately, one of the main features of the PHP system is a tool that allows it to load an…
taxilian
  • 14,229
  • 4
  • 34
  • 73
34
votes
5 answers

How to convert/save d3.js graph to pdf/jpeg

I'm working on a client-side/javascript function to save or convert an existing D3-SVG graph into a file. I've searched a lot and found some recommendations, mainly using canvas.toDataURL(). I have no in my page, and instead…
Moein
  • 739
  • 2
  • 9
  • 17
33
votes
2 answers

HTML to PDF conversion using Chrome pdfium

Can anyone suggest how to convert HTML to PDF using chrome pdfium. Since, I tried pdf.js and few other, but It is not giving me a proper result. I think chrome pdfium handle them properly. So, I would like to give a try to pdfium for generating PDF…
john
  • 859
  • 2
  • 12
  • 25
33
votes
10 answers

Split each PDF page in two?

I have a large number of PDF files which have two slides to a page (for printing). The format is A4 pages each with two slides setup like so: ----------- | slide 1 | ----------- | slide 2 | ----------- How can I generate a new PDF file with one…
stackoverflowuser95
  • 1,992
  • 3
  • 20
  • 30
32
votes
10 answers

"no module named PyPDF2" error

I use Spyder, with Python 2.7, on a windows 10. I was able to install the PyPDF2 package with a conda command from my prompt. I said installation complete. Yet, If I try to run a simple import command: import PyPDF2 I get the error: ImportError: No…
ALisboa
  • 434
  • 2
  • 5
  • 14
31
votes
4 answers

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

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?
carrier
  • 32,209
  • 23
  • 76
  • 99
31
votes
4 answers

Converting Twitter bootstrap page into PDF with wkhtmltopdf : span issue

I am using Symfony2 Bundle KnpSnappyBundle to convert an html twig template to a pdf. KnpSnappyBundle is base on Snappy wrapper, that use wkhtmltopdf. My template use twitter bootstrap 2.3.2 css like this :
qdelettre
  • 1,873
  • 5
  • 25
  • 36
31
votes
3 answers

Custom Fonts for DOMPDF

I'm Using DOM PDF 0.6.0 Beta 2. I want to use custom fonts (Fonts: 'Segeo Print', 'Lucida Handwriting','Airplanes in the Night Sky') in PDF file. I followed the guidelines to install and use fonts in my PHP Code, which is given here…
pinaldesai
  • 1,835
  • 2
  • 13
  • 22