Solved

HTML to PDF conversion on the fly

Posted on 2004-08-02
8
321 Views
Last Modified: 2010-04-17
Hi All

We re developping a web app with php4x under Linux/Apache. We need to generate pdf documents on the fly from current html screrens without too much coding. The free libs are taking too much time to develop. I would appreciate if you can share your experiences. I m not expecting coding courses but some indication of solutions that might help us to go to the right direction. Both proprietary and open source libs are wellcome.

Many thanks
regs
Tuncay
0
Comment
Question by:tgunduz
8 Comments
 
LVL 3

Expert Comment

by:pYrania
ID: 11693570
With the pdflib wrapper that's builtin in php it's fairly easy to create your pdf files.

http://www.php.net/manual/en/ref.pdf.php

<?php
$pdf = pdf_new();
pdf_open_file($pdf, "test.pdf");
pdf_set_info($pdf, "Author", "Markus Nigbur");
pdf_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0");
pdf_set_info($pdf, "Creator", "See Author");
pdf_set_info($pdf, "Subject", "Testing");
pdf_begin_page($pdf, 595, 842);
pdf_add_outline($pdf, "Page 1");
$font = pdf_findfont($pdf, "Times New Roman", "winansi", 1);
pdf_setfont($pdf, $font, 10);
pdf_set_value($pdf, "textrendering", 1);
pdf_show_xy($pdf, "############# YOUR TEXT HERE #########", 50, 750);
pdf_moveto($pdf, 50, 740);
pdf_lineto($pdf, 330, 740);
pdf_stroke($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
pdf_delete($pdf);
?>
0
 

Author Comment

by:tgunduz
ID: 11693986
Hi,

Sorry If I could not express myself correctly.

I am afraid it is not suitable to our needs. As far as my knowledge goes, this option requires continious coding  to build the entire document. What I'm looking for is to "wrap" an existing html page and generate a pdf document on the fly.

Thank you
Regs
Tuncay  
0
 
LVL 2

Expert Comment

by:Caiapfas
ID: 11697093
How about a browse feautre that lets users select a .doc file and translate it in pdf.

how could you do this?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 18

Accepted Solution

by:
JR2003 earned 25 total points
ID: 11697268
Just install a freeware PDF printer driver. Either cutePDF or PDFCreator. These are both PDF printer drivers, but they only work from Windows OS not Linux - this is the VB forum though!

All you do is load your HTML document into a web browser control and then print it to the PDF printer driver.
cutePDF has a programmable version (not freeware) where you can set the filename of the output PDF file in the registry.

Go to the following sites to download:
http://sourceforge.net/projects/pdfcreator/
http://www.cutepdf.com/
0
 

Author Comment

by:tgunduz
ID: 11701089
Thank you for your comments.

What I am looking is a server side pdf generation. The users are remote users . We can not expect them to install pdf drivers to generate the pdf documents

Basically the best solution would be server side html to pdf conversion on the fly with either open source or proprietrary tools.

many thanks


 
0
 
LVL 5

Assisted Solution

by:8riaN
8riaN earned 25 total points
ID: 11776424
This looks like it will do what you need, provided that the HTML isn't horribly complicated:

http://html2fpdf.sourceforge.net/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstChar challenge 13 107
firstswap challenge 20 65
Export Table to CSV - Access to CSV - using python 18 96
How to obtain Administrator permission when you are the Administrator 6 58
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This is an explanation of a simple data model to help parse a JSON feed
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

919 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now