converting google map to pdf in coldfusion - pdf

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.

Related

XPage - Open scans in browser

I need to display uploaded scans (JPG, PNG, TIFF, PDF, etc.) in the browser's window instead downloading them to a local pc and using external apps like Acrobat Reader.
I made some research in the web on that issue but wasn't really successful.
Does anyone have hints, code snippets, how to achieve that ?
EDIT :
Since I am not looking for a solution which supports viewing scans in a typical browser like Chrome, FireFox, etc. but supports viewing scans in an XPage view within Notes I need to ask my question again.
What is the best (recommended) way to view different types of scans, uploaded as PDF, JPG, TIFF, PNG, etc., in Notes within an XPage view ?
Take a look here, XPages: Embed PDF and possibly Office files
Here is some code that I have in an app for PDF's.
I tried using Bumpbox, and pdf.js and while I could get them working, iframes seemed to work best for me with using normal Domino attachment urls in xpages
I am not sure if this solution is right or not, but it works well for an app I have that only has PDFs. It does work on mobile too, at least on iOS.
<iframe
src="#{javascript:
var url = 'https://app.nsf/';
var doc = sessionScope.docID;
var atname = #RightBack(sessionScope.aname,'Body');
var end = '/$file'+atname;
return url+doc+end}"
width="800" height="1000">
</iframe>
If you are looking at using different file types you need to use a renderer, give it the attachment URL, and then display what the renderer returns with. I haven't looked at this in a while so things might have changed. Look for a lightbox clone that can display pdf. I think Orangebox was one, bumpbox looks to not be updated but I was able to get that working for me.
This method will display everything inline. I would love to see some type of renderer like pdf.js for xpages.

How do you put tracking code in a PDFLaTeX file

Suppose I have a PDF page (generated by say PDFLaTeX) that is accessed like a web page would. Is it possible to put a tracking code on it (for usage analytics) in a way similar to an HTML page?
Try this: https://github.com/igrigorik/ga-beacon
It can work where javascript doesn't such as emails, stackoverflow answers or github.

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.

How to save a template as PDF in symfony

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.

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.