Skip to main content
added 7 characters in body
Source Link
gbajson
  • 1.6k
  • 16
  • 35

PyPDF2 is very good choice when you need to change existing PDFs, but it requires deeper knowledge of pdf format when you need to create PDF from scratch.

You might consider using a different library for this task i.e. pdfkit (https://github.com/JazzCore/python-pdfkit), sample program:

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')

PyPDF2 is very good choice when you need to change existing PDFs, but it requires deeper knowledge when you need to create PDF from scratch.

You might consider using a different library for this task i.e. pdfkit (https://github.com/JazzCore/python-pdfkit), sample program:

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')

PyPDF2 is very good choice when you need to change existing PDFs, but it requires knowledge of pdf format when you need to create PDF from scratch.

You might consider using a different library for this task i.e. pdfkit (https://github.com/JazzCore/python-pdfkit), sample program:

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')
Source Link
gbajson
  • 1.6k
  • 16
  • 35

PyPDF2 is very good choice when you need to change existing PDFs, but it requires deeper knowledge when you need to create PDF from scratch.

You might consider using a different library for this task i.e. pdfkit (https://github.com/JazzCore/python-pdfkit), sample program:

import pdfkit

pdfkit.from_url('http://google.com', 'out.pdf')
pdfkit.from_file('test.html', 'out.pdf')
pdfkit.from_string('Hello!', 'out.pdf')