How to use external images in PDF using wicked_pdf - ruby-on-rails

I want to embed some external images to pdf i am using tag for doing this but image is not display in pdf. How to show external images inside pdf

Try using this version of wkhtmltopdf.
This may solve your problem.

Related

Export to Pdf via rails

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.

Rails - Editing PDF template

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.

How to show image in header while pdf/print from webpage using phantomjs

I am new to phantomjs. Installed phantomjs 1.9.7.
I'm generating pdf files using phantomjs(example: printheaderfooter.js) but I would like to repeat a defined header with HTML, it works when there are no images but as soon I add it doesn't work.
Is there any way to show image in header?

Adding metadata to PDF generated using Wicked 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.

Add PDF page in iOS

I have an algorithm to create a PDF file, but I want just to add one pdf page at the end of existing pdf. Do any one has idea about that?
Here is a solution for merging pdf but using an other library:
Merge PDF files on iOS
May be you can read the old pdf file,and recontruct a new pdf file.I think.
Up till now it's not possible to reopen and continue editing a PDF file . Only redraw whole PDf again .

Resources