How to save a template as PDF in symfony - pdf

I am using Symfony1.4 with doctrine. I want to save a invoice template to PDF. How can i do this.

I use for this sfTCPDFPlugin

For converting HTML to PDF, I get the best results with Wkhtmltopdf. Because it uses the Webkit rendering engine (the same used in Chrome and Safari for example), the results are exactly the way you can see the HTML rendered in those browsers.
It is in fact just a binary you can run from the command-line, but an example PHP wrapper class is available from the website. I also did not find it very hard to write a wrapper class myself with some added functionality.

Related

PDF converter for HTML

I am searching for a product that converts HTML to PDF in VB. I have searched alot for the products, but most of them are very expensive or doesn't work very well. Can anyone suggest me of a good quality, working product?
Thanks
Try using mPDF. mPDF is a PHP class which generates PDF files from UTF-8 encoded HTML. Its free and works very good.
http://www.mpdf1.com/mpdf/index.php
See WKHTMLPDF.
I have checked quality and used this tool. This is the good one and Opensource. This is shell utility to convert html to pdf using the webkit rendering engine, and qt.
I use htmldoc
Don't know if it fits your definition of "works very well", but for me, it does the trick.
A different approach is to install a print-to-pdf printer driver (such as freepdf), and print from the browser.

Selenium output url

I need to test an output of a page without making it pop up, but just go to the url.
If you have a pdf or word export link how would you test its contents.
The answer is to step outside of Selenium
To test a URL without making the window pop-up, consider downloading the contents of the URL without Selenium. I'm assuming you are using Java, so look into downloading the content of a URL in java. It also depends on what you are testing, this works if you want to just check if a URL is broken or not for example.
To check the contents of a PDF or a Word file, you also can't use Selenium. You will need to find a Java library to parse the PDF and Word files and then use that to read the content.
As you can see both require a bit of research on your part. The key is not getting hung up on Selenium and making use of the rest of the programming language.

Is there a way to create reports in PDF for iOS?

I am looking for a way to create a report in an iPad, a lib in c, c++ or objc or something.
What i want to do, is to fill an invoice data, and let the user choose his template from a set. The report must be a PDF.
edit:
I actually need something like crystal reports, or a way to have lots of predefined templates and be able to render them.
edit2:
In the end i had to create an own report-system to handle the creation of the pdf.
Here is the official documentation for creating pdf's.
If you can rely on the internet connection, check out jsreport. It is capable of storing as many report templates you like. It also contains editor where you can prepare your templates using html, css and javascript templating engines.
For actual pdf rendering, you just send data from iPad to jsreport rest api and get back pdf.
Note: I am the author of jsreport

converting google map to pdf in coldfusion

Given that coldfusion is server side and javascript is clientside, is there anyway to convert a google map to a pdf using coldfusion?
Why don't you try static google map to embed map in pdf. Static map generate image file which will easily added thorough cfdocument. I haven't tried but it should work...
For more detail see
http://code.google.com/apis/maps/documentation/staticmaps/
I suggest wkhtmltopdf. You give it a --javascript-delay of something like 800ms, and you're good to go.
wkthmltopdf is a command line app that runs on a variety of OSes.
This is what I would do:
Create a page that correctly loads the map that you want to convert to a pdf.
Use the cfdocument tag to create the pdf. Something like this: <cfdocument format="pdf" src="[url to your page]" ... />
Be sure to test thoroughly. cfdocument isn't known for it's ability to properly handle CSS.
NOTE: Be sure to check Google's terms of service before you do this.

Jekyll documentation to PDF with TOC

I would like to write documentation using Jekyll with HTML and PDF outputs. Html can have a navigation but the PDF should have table of contents. Is there a free and easy way to do that?
The HTML part is easy but I would like to use #media print CSS for making the PDF file.
I have a few ideas how to do this.
Use PrinceXML, unfortunately this is commercial product with a nasty price tag ~$500
Use WKHTMLTOPDF
Use Maruku, since it is possible to do a PDF conversion using it
I would like to have multiple pages HTML and single page PDF with a TOC. Any suggestions?
Btw. Buildr has solved this problem using PrinceXML.
If 'free' is your most important criterion, than wkhtmltopdf is your best bet. It supports things like covers, toc, headers, footers and sections. Depending on how exotic the layout of your document will be, you most likely will run into some page-break issues, but with a bit of tinkering you should be fine.
I've been using wkhtmltopdf for a bit now, with some quite complicated documents (with javascript charts, tables, svg images, etc.) and have not run into too many issues.
Make sure you use the static version of wkhtmltopdf, as it is the only version which supports rendering of a TOC page.
You can use the PDFKit gem, which uses wkhtmltopdf behind the scenes. Then you can put your PDF logic in a Jekyll plugin as a generator or converter.
For generating a table of contents using Jekyll, you can use the {:toc} macro offered by markdown, or write your own textile table of contents filter if you prefer to use textile..
For generating a PDF from Html and CSS, I have found weasyprint to be a good solution. Since they do not rely upon an external engine for rendering, they do not depend upon foreign project's roadmaps for implementing relevant features such as CSS generated content or #page CSS-declarations. (But in contrast to wkhtmltopdf, weasyprint does not parse javascript).
You could also use a browser extension called Awesome Screenshot to create JPEG/PDF from a page. The extension allows you to create a full-page image or export it to PDF. With this tool, you can export all pages really quickly (and/or later combine all PDFs together to create a single document).
I am aware this is a quick & dirty solution (not perfect). E.g: while using images instead of text, the full-text search will not work. Additionally, it may require some manual work, but it does the job when you just want to read it.