let user download pdf by converting html information into pdf - python

I have informations which pops up in fancybox, e.g. a user form(which includes images, his/her address, phone no, name etc..), now how can I convert that into PDF and let user download pdf file. Can this be achieved using jquery.
I use datatables to show rows of user informations, which when clicked in individual rows are popped up in fancybox. There is a plugin in datatables called datatools which lets user to convert table into csv, xls, pdf file, which uses 'swf' file. Is there some way to convert html rendered page to pdf ??
I am using python2.7, flask

You can convert HTML to PDF using WKHTML2PDF.

Related

PyPdf2 interactive form elements missing after Adobe sign

I have an Acroform pdf that contains a combination of text and interactive fields like dropdowns and checkboxes. I am using PyPDF2 to successfully retrieve all the field values (using get_Fields() and decrypting it with the default '' password), however once the pdf is signed using Acrobat Sign, I cannot access the interactive fields anymore. I read on another SO post that signing a pdf flattens it, however I can still access all the text fields after signing.
I have tried both PyPDF2 and the java RUPS iText 5.5.9 desktop app, and neither of them can see any interactive fields (dropdowns, checkboxes, datepickers) after signing the pdf. Is there a way to read interactive fields at all after signing?
Thank you.

How to make PDF fillable?

I have links to unfillable PDFs and I want to make them fillable in my python application.
I could use Adobe SDK for Python, but does this allow me to automate PDF fillability. I just want to create the fillable fields and display the PDF for users to fill out. I have 10,000 PDFs, so I want to just call the API to make them fillable. The fields are different in every PDF.
Adobe's Fill and Sign manual application that works really well. Do they have an API that will mimic this?

How to create a PDF with Python "appending" a HTML file and information from a database?

I want to automate some report creation. Some elements that I need in the report are saved as rich text, so an HTML file. There are a couple of libraries to do this, such as html2pdf or pdfforge. However, I would also like to add extra information to the report that is not located in this HTML file, like for example a title or some information queried from the DB that is not necessarily in the HTML file.
Does anyone have a suggestion to do this?
Thanks in advance.

How do I link to a specific page of a PDF document inside a cell in Excel?

I am writing a python code which writes a hyperlink into a excel file.This hyperlink should open in a specific page in a pdf document.
I am trying something like
Worksheet.write_url('A1',"C:/Users/...../mypdf#page=3") but this doesn't work.Please let me know how this can be done.
Are you able to open the pdf file directly to a specific page even without xlsxwriter? I can not.
From Adobe's official site:
To target an HTML link to a specific page in a PDF file, add
#page=[page number] to the end of the link's URL.
For example, this HTML tag opens page 4 of a PDF file named
myfile.pdf:
Note: If you use UNC server locations (\servername\folder) in a link,
set the link to open to a set destination using the procedure in the
following section.
If you use URLs containing local hard drive addresses (c:\folder), you cannot link to page numbers or set destinations.

Generate multiple OpenOffice pages from a one-page template

I have a one-page OpenOffice document which is a POD template. Basically, I use this template to replace tags in the template with automatically generated data in the rendered document.
This is how it works:
# loads the POD OpenOffice template engine
from appy.pod.renderer import Renderer as OORenderer
# defines data for template tags
ctx = {'template_tag': 'my_data'}
# renders the template in my_model.odt using defined data
r = OORenderer('my_model.odt', ctx, 'rendered_file.pdf')
# saves into the specified PDF file
r.run()
I would like to generate several pages like that, and merge them into a single PDF file.
Is there a way to do it using POD?
Or maybe can I programmatically merge generated PDF files into a single file?
Thank you!
and merge them into a single PDF file.
just try pyPDF.
A Pure-Python library built as a PDF toolkit. It is capable of:
extracting document information (title, author, ...),
splitting documents page by page,
merging documents page by page,
cropping pages,
merging multiple pages into a single page,
encrypting and decrypting PDF files.

Categories