I need to generate report to pdf file, save on the server, than send the file to the client by email.
I am looking to a gem for exporting pdf file
And I want to know if the file keep all the pdf options (like links and the option to select text copy text etc')
Thanks
You can use wicked_pdf gem to generate PDF from HTML. You can configure the options whatever you want in their advanced usage.
Wicked PDF is what you need. It will export to PDF and keep all links, text and images as a real PDF would, because it generates a real, full fledge PDF.
Related
I am creating app where i need to load the pdf file from document directory and need to highlight text manually by user.
Also we need to export the updated pdf file and upload it to the server.
Is there any way to manage the same using pdfkit ?
Please share the sample code if available.
We are using the library as a reference is listed below
https://github.com/uxmstudio/UXMPDFKit
This library is using the same concept as we need but exporting the pdf is the main task we need to achieve.
In simple word we can say that user can highlight some text from the displayed pdf text and upload it to the server.
I need a user to be able edit a pdf template in rails such that a user can customise logo, email signatures, price etc.
I thought prawn looked like a good option but I read that it should now only be used to generate a pdf from scratch.
Any help, suggestions, pointers to tutorials would be really helpful.
Thank you.
The pdf-forms gem can fill out existing pdf files. This has worked well for me for inserting text into a template PDF.
pdftk supports adding images to an existing pdf via multistamp, which is effectively merging two pdfs together (on top of each other). To add an image to an existing pdf, you could use something like prawn to create a pdf with your image, then use pdftk with multistamp to merge that with your filled out pdf:
pdftk filled_out.pdf multistamp logo.pdf output out.pdf
pdf-forms is a thin wrapper on top of pdftk, so it should allow you to pass the multistamp params required. If not, you can add that functionality or shell out to pdftk directly.
Adobe Acrobat Pro is useful for defining your template fields visually in an existing pdf.
I am not sure but try your luck with Wicked pdf.
I created a template for a document i want to use, in photoshop.
I want to share this document as a PDF file.
I want some of the text i made in photoshop to work as hyperlinks and direct ppl to websites.
How do i save a photoshop file as a PDF and get hyperlinks to work in the PDF file?
I have tried using the slice tool. It works to assign a url and target.
But when saved as a PDF the links do not work.
Anyone?
I know that indesign allows for saving pdf documents in either print or web format. the latter allows for hyperlinks to be available. if photoshop does not offer this you can always add them in acrobat (not reader) and then resave the .pdf.
I'm using Wicked PDF to generate a PDF from HTML. I've seen this SO question on adding metadata to a PDF, and it suggests using XMP metadata. How can I use Wicked PDF to add XMP metadata to a generated PDF?
If you are creating the original document using Prawn as you say, then just use the info attribute to set the meta-data you need. See the manual and search for :info. I'm not sure what you mean when you say Wicked PDF adds a title. PDF documents don't have titles (although sections and subsections can in the outline). See this discussion, for example.
If you can't add metadata directly with WickedPDF, you might try using another library to add the metadata after the PDF is generated (a two step process).
I found an SO answer that suggests PDFtk might be able to do that: https://stackoverflow.com/a/18536830/473691.
I have an application which takes in a zip file as its input. The zip file contains a html file, its css and the images. I need to convert this html to pdf and send back. I have looked at Prince XML and wicked PDF but dont know how to perform this exact task.
It is like my application should act as a HTML to PDF converter. They will send us zip files and my app should generate the corresponding PDF. How to go about this task.
You can use PDFKit gem.
https://github.com/jdpace/PDFKit
http://www.jonathanspies.com/posts/11-Simple-PDFkit-example-in-Rails-3
The process I would implement is:
Upload the zip via a form
Unzip the contents
Process the html file within using Hpricot or similar (if you need to tidy it up first)
Convert the raw html to PDF with https://github.com/jdpace/PDFKit