PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 23rd, 2002, 07:40 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
php & pdf

I am new to PHP. I am trying to create and display a pdf file in my php page.
I have PHP 4.1.1 and PDFLib 4.0.3. Your help is very much appreciated.



Can anybody tell me what's wrong with the following code, NO errors in the log file.I am sending the output to the browser but nothing is getting displayed.


<?

$pdf = PDF_new();
PDF_open_file($pdf);

header( "Content-type: application/pdf" );
header( "Content-Disposition: attachment; filename=modulo.pdf" );
header( "Content-Description: PHP3 Generated Data" );

PDF_begin_page($pdf, 595, 842);

$im = PDF_open_jpeg($pdf, "pass4_sml.jpg");

pdf_place_image($pdf, $im, 100, 300, 3);

pdf_end_page($pdf);

PDF_close($pdf);

$buffer = PDF_get_buffer($pdf);

?>


is there some issue with my set up

Thank u

Reply With Quote
  #2  
Old August 23rd, 2002, 07:59 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: php & pdf

i've never worked the pdf extension.. but, try this
php Code:
Original - php Code
  1.  
  2. <?php
  3.  
  4. $pdf = PDF_new();
  5. PDF_open_file($pdf);
  6.  
  7. PDF_begin_page($pdf, 595, 842);
  8.  
  9. $im = pdf_open_image_file($pdf, "jpeg", "pass4_sml.jpg");
  10.  
  11. pdf_place_image($pdf, $im, 100, 300, 3);
  12.  
  13. pdf_end_page($pdf);
  14.  
  15. PDF_close($pdf);
  16.  
  17. $buffer = PDF_get_buffer($pdf);
  18.  
  19. header('Content-type: application/pdf');
  20. header('Content-disposition: inline; filename=test.pdf');
  21. header('Content-Description: PHP3 Generated Data');
  22. header('Content-length: ' . strlen($buffer));
  23.  
  24. echo $buffer;
  25.  
  26. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > php & pdf


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway