Converting google map to pdf in php - php

I am using TCPDF for generating PDF documents and i want to convert a google static image map into my pdf. How can i achieve this, some examples?

Why don't you try static google map to embed map in pdf. Static map generate image file which will easily added thorough document. I haven't tried but it should work...
For more detail see http://code.google.com/apis/maps/documentation/staticmaps/

Build the google static map link, docs can be found http://code.google.com/intl/nl-NL/apis/maps/documentation/staticmaps/
Use the writeHTML method of TCPDF to write the following:
<img src="http://yourgooglemapurl.com"/>

Related

Create PDF Laravel 5.5?

I want to create a pdf page from html file in Laravel but I do not know how to do it. You can help me
https://github.com/barryvdh/laravel-dompdf
// Import in top of controller file
use Barryvdh\DomPDF\Facade as PDF;
// use below code to generate and download pdf file
$pdf = PDF::loadView('bladefilename', ['arrayname' => $array]);
return $pdf->download('filename.pdf');
Write Above code in the controller file
In Blade file (HTML file) set array data.
Show Below Link : https://github.com/barryvdh/laravel-dompdf/issues/126
I know I am a little bit late but hopefully this will help someone.
There are 2 ways:
Create HTML page and use jspdf to print this page. The best way is to use html2pdf: https://github.com/eKoopmans/html2pdf.js
You can use this one to convert html to canvas and print to pdf. All css will be kept but you have to change the page to fix the space between pages as there may be some bad cut at the end of each page.
Print the page using latex. You have to use laravel latex compiler: https://github.com/fvhockney/latexcompiler
It is a little bit harder to styling the page but there is no problem with paging.

FPDF Text with HTML tags

I'm using FPDF to create an A4 sized PDF, I can add text/images and this is working fine. I have a dynamically generated string which contains some HTML tags (BR etc) and was wondering how I can have that output onto the PDF as opposed to literally printing the tags out.
$centre = urldecode($row_CertDetails['centre_name']);
$pdf->Text(10, 110, $centre);
I've seen on some forums people mentioning WriteHTML, however my version of FPDF doesn't seem to include that.
Is it an add-on?
Yes, it is an Add-On:
Write HTML
Author: Clément Lavoillotte
License: FPDF
This is an enhancement of the WriteHTML() method from tutorial 6. Supported tags are: ...
Please see Write HTML FPDF Script #42 which I think is the latest version, but feel free to browse the FPDF scripts/Add-Ons.
I've solved it anyway.
Because I'm also using FPDI, what I did was extract the contents of the class in http://www.fpdf.org/en/script/script42.php and put it inside the FPDI.php file.

Generate a JPEG from $html in JS and/or PHP

Want to get an image (JPEG) from $html variable in PHP.
Steps:
Transform my code to a canvas in HTML5
Transform my canvas in image.
I know the steps but I do not know how to code them.
I do not want to use wkhtmltopdf.
Thanks for your help.
PS: Saw that (Website screenshots using PHP) but it's not in HTML5.
--
EDIT:
Try to use this but do not work...
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=document.body;
ctx.drawImage(img,10,10);

How to get `thumbnails document` like google doc?

How to get thumbs document (doc, docx, pdf, pptx, ppt,.....)?
May be use C#, php, .....
Please help me!
Thanks you very much!
This has been asked before ... please see Live Thumbnails/Large Image for some examples
It only capture web sites but its the same for every other document types .... all you need to do is convert (doc, docx, pptx, ppt,.....) to pdf or HTML or image ... PDF is easier to work with but some online tools can also convert doc to image directly ..
When you have it pdf you can easy convert it to jpg then create a thumbnails form jpg
See more tools you can use
See
http://www.imagemagick.org/www/formats.html
exec("convert sample.pdf sample.jpeg")
See
http://www.phpclasses.org/package/5846-PHP-Convert-PDF-documents-to-images-using-Ghostscript.html
See
How do I convert a PDF document to a preview image in PHP?
I hope this helps
Thanks
:)

How to convert HTML to PDF using PHP?

I want to convert HTML with Google Charts reports to PDF,I used fpdf and other classes but I didnt get success.
please help me .
You can try using HTML 2 PDF available from sourceforge here
You could also try dompdf

Categories