SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2002
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with PDF Class (problem not covered in manual)

    Hi All

    I have been using the PDF class available at the "http://ros.co.nz/pdf/" website. I can get it to do everything except for one important thing.

    I can't work out how to get the PDF to download onto my computer. Every time I click my download button, the generated file is displayed on the screen. I want the generated file to download as a file. For example, when I click the download button on my page, a dialogue box should appear asking if the file should be downloaded or not.

    Does anyone have any ideas on how I might do this?

    Kind regards, Ben

    My code is as follows
    PHP Code:
    /* Create PDF file */
    include('class.ezpdf.php');
    $pdf =& new Cezpdf('a4','portrait');
        
    /* Set title of PDF Document */
    $pdf -> selectFont('./fonts/Helvetica.afm');
    $pdf -> setLineStyle(1'round');
    $pdf -> line(30754550754);
    $pdf -> line(30820550820);
    $pdf -> ezText($row['title'], 20, array('justification'=>'center'));

    /* Set header image */
    //$image = "image.jpg";
    $pdf -> addJpegFromFile('image.jpg'307579060);

    /* Set date of PDF Document */
    $pdf -> ezText(' '10, array('justification'=>'left'));
    $pdf -> ezText('Published '.$date10, array('justification'=>'center'));
    $pdf -> ezText(' '10, array('justification'=>'left'));

    /* Set body of PDF document */
    $pdf -> ezText(' '10, array('justification'=>'left'));
    $pdf -> selectFont('./fonts/Times-Roman.afm');
    $pdf -> ezText($content12, array('justification'=>'left'));
        
    $pdf -> ezstream(); 

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi , using that (excellent) class and you code produces a download box for me in IE5.5 but not (surprise!) in Mozilla)

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2002
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply. I am also using IE 5.5, but I don't get the download option. Is there something else that I need to add to my code. What about sending headers, etc.

    If you have no objections, can I have a look at the "full" code you just used? I have a strange feeling my problem is not in the code I posted here, but somewhere else on the page. Although the only code preceeding it on my page is that for retreiving data from the DB.

    Many thanks, Ben

  4. #4
    SitePoint Zealot
    Join Date
    May 2001
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I belive this is due to the way the user has configured their verion of Internet Explorer and Adobe Acrobat. e.g. their selections on instalation and weather they installed it with IE or seperatly.

    Even if you have it embeded in IE you can still save the document using the adobe menu.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •