Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

HTML to PDF conversion on the fly

Posted on 2004-08-02
8
Medium Priority
?
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Accepted Solution

by:
JR2003 earned 100 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 100 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

604 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