Solved

export from html to pdf

Posted on 2008-06-25
12
982 Views
Last Modified: 2010-05-18
is it possible to stream html-output to pdf (including images, tables, ...)?
I have tried fpdf but it cannot stream html to pdf. It has own syntax.
I cannot install perl or ghostscript.
I wanted to use dompdf, but i've heard it has leaks and conflicts with domxml.

Can anyone help me?
0
Comment
Question by:worxsteven
  • 5
  • 5
  • 2
12 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 21867655
If you can't install an external program like htmldoc it is not possible via php.

Also never heard of a class which support rendering html to pdf and works with images, ...
0
 

Author Comment

by:worxsteven
ID: 21867932
ok, so what do you suggest as the easiest and best solution to render html to pdf? (on linux)
0
 
LVL 48

Expert Comment

by:hernst42
ID: 21868235
install htmldoc and let html do create the pdf via exec
http://www.htmldoc.org/
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 17

Expert Comment

by:nplib
ID: 21868242
0
 
LVL 17

Expert Comment

by:nplib
ID: 21868250
fdpf allows you to make pdfs using php and html
more so html inside php.
0
 

Author Comment

by:worxsteven
ID: 21871952
so if i add a background to the html, tables, font sizes + colors, ... the fpdf can convert this to pdf with some single commands? What do i have to do to create this: http://www.worx.be/test.html
0
 
LVL 17

Expert Comment

by:nplib
ID: 21877257
That you will have to download the class first, I've never used it personally, I know of a lot of people who have used it, and I have participated in a lot of discussions on the subject.

After you download the file, and check out the doc, I can help you after that,
0
 

Author Comment

by:worxsteven
ID: 21878588
what class?
0
 
LVL 17

Expert Comment

by:nplib
ID: 21878601
the fpdf class from http://www.fpdf.org/
0
 

Author Comment

by:worxsteven
ID: 21879115
i already knew that, but it can't just convert html (tables, backgrounds, fonts, ...) into pdf. You need to use the fpdf-syntax right? Isn't there another way?
0
 
LVL 17

Expert Comment

by:nplib
ID: 21883487
well No,

but if you look at the tutorial, you will see how they converted html into "fpdf syntax".

if your html is static code, you can always use file_get_contents() function to place your html into a working variable.
http://www.php.net/manual/en/function.file-get-contents.php
0
 

Accepted Solution

by:
worxsteven earned 0 total points
ID: 21896907
i managed to use dompdf, so problem solved.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question