Jump to content
xisto Community
signatureimage

How To: Create PDF With Php Create on-the-fly PDF on the web server

Recommended Posts

contents from MySQL

How To: Create PDF With Php

 

How can I generate contents in the pdf using data coming from MySQL database ??

 

-reply by Mohamed badr

Share this post


Link to post
Share on other sites

Interesting tutorial! Do you know if it is possible to convert the PDF File into content management system. This is the thing I would like to know about it, Let's say, I have a PDF file on my local drive, and I want to convert that file into my database, or using CMS editor to do so, and this file will automatically will be added to my database, by parts, chapters and so on.

Share this post


Link to post
Share on other sites

How about creating a PDF from whatever program you would normally use, such as inDesign or Word and then updating text fields with data generated from a PDF query?  This seems like a streamline method that would allow a template to be created in more detail and then use PHP to populate various fields as a final product.

Any plans on doing a tutorial that covers these features?

 

Thanks

Share this post


Link to post
Share on other sites
Table formatting in pdf creationHow To: Create PDF With Php

I am trying to create a pdf document using php, but I want to include a table layout with data I will type in  eg

 

          Form Name

Tests Performed |By Whom |When

New           |   tester |12-01-2009 

 

I'm not seeing anything in the PDF_functions that deal with adding a table layout. Can anyone assist? 

-question by MichelleKeywords:

Share this post


Link to post
Share on other sites
Parameter too shortHow To: Create PDF With Php

Hi

I got really excited when I saw the php file creating my first pdf. Really cool

The only thing is that when I got o the image backround section I got an error 

Fatal error: Uncaught exception 'PDFlibException' with message'pdf_open_image_file() expects exactly 5 parameters, 3 given' inC:wamp_newwwwpdf_createnewpdf.Php:7Stack trace:#0 C:wamp_newwwwpdf_createnewpdf.Php(7):Pdf_open_image_file(Resource id #2, 'jpeg', 'matrix.Jpg')#1 {main} thrown in C:wamp_newwwwpdf_createnewpdf.Php on line 7

I've put my jpeg in the same folder as the php file and copied your code as is.

And another error Where you draw only the Triangles

Fatal error: Uncaught exception 'PDFlibException' with message'pdf_setcolor() expects exactly 7 parameters, 6 given' inC:wamp_newwwwpdf_createnewpdf.Php:9Stack trace:#0 C:wamp_newwwwpdf_createnewpdf.Php(9): pdf_setcolor(Resource id#2, 'fill', 'rgb', 1, 1, 0)#1 {main} thrown in C:wamp_newwwwpdf_createnewpdf.Php on line 9

Maybe you can give me some advise so I can get this working. I'm using WAMP2 for PC

-reply by Jacques

 

Share this post


Link to post
Share on other sites
Thanks and congratulationsHow To: Create PDF With Php

I'm currently developing an app to construct a pdf from a table, your page is amazing and with great info, very clear and simple to understand. Very good job, thanks for sharing this tutorial.

-reply by Hector

 

Share this post


Link to post
Share on other sites
how to fetch data from database and print in pdf.How To: Create PDF With Php

hello all

this is wonderfullsite.

I would like to know how we can call data from mysql and export data to pdf.

please provide code for this problem.

may be all other will also get benefited by this

thanks 

vinayg

Share this post


Link to post
Share on other sites
ThanksHow To: Create PDF With Php

Hi. I thank you for posting something greatly explained with tons of steps to make it even easier.

Greetings from Mexico! 

-reply by Juan

Share this post


Link to post
Share on other sites
PDFlibExceptionHow To: Create PDF With Php

add, the extra parm as if for the case of using cmykPDF_setcolor($mypdf, "stroke", "rgb", 0, 0, 1, 2);

Share this post


Link to post
Share on other sites

I met something error when I'm trying to use:

$myimage = PDF_open_image_file($mypdf, "jpeg", "training_bground.Jpg");PDF_place_image($mypdf, $myimage, 50, 650, 0.6);

what's "training_bground.Jpg" ? may it an filename in http (such "http://forums.xisto.com/no_longer_exists/;) ??

I use Drupal Webform , and the message like bellow appeared :

warning: pdf_open_image_file() expects exactly 5 parameters, 3 given inC:apachexampphtdocsfmipamatematika-123asdfmoduleswebformwebform.Module(1759): eval()'d code on line 26.

wha's wrong ???

 

Share this post


Link to post
Share on other sites
I donHow To: Create PDF With Php

Thank you, sir, for these wonderfully clear and comprehensive instructions!  I have been needing to implement some pdf generation for quite some time, now, but I could never quite get the gist of making one until I ran across your how-to.

Thank you again,

Eileen

-reply by Eileen

Share this post


Link to post
Share on other sites
Many ThanksHow To: Create PDF With Php

It's a great helping tutorial I have ever seen. Thank you very much again...

-reply by yasin

Share this post


Link to post
Share on other sites

<p>I use Drupal Webform , and the message like bellow appeared :</p><p>warning: pdf_open_image_file() expects exactly 5 parameters, 3 given in
C:apachexampphtdocsfmipamatematika-123asdfmoduleswebformwebform.Module(1759)
: eval()'d code on line 26. </p>
<p>wha's wrong ???</p>

Exactly as stated. This means that, in your environment, pdf_open_image_file needs five arguments, and you only provided three of them.
Now the funny game will be to find which are the missing ones, maybe you should provide empty arguments by means of a "".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.