Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:44:29+00:00 2026-05-14T04:44:29+00:00

I was trying out the following code which actually saves the pdf file to

  • 0

I was trying out the following code which actually saves the pdf file to C:/xampp/
I want to create a link so that when the user clicks on it. It prompts it to save the pdf file.

<?php  
// create handle for new PDF document  
$pdf = pdf_new();  

// open a file  
pdf_open_file($pdf, "try1.pdf");  

// start a new page (A4)  
pdf_begin_page($pdf, 595, 842);  
pdf_set_parameter($pdf, 'FontOutline',

'Arial=c:\windows\fonts\arial.ttf');
// get and use a font object  
$font = pdf_findfont($pdf, "Arial", "host", 1); 

pdf_setfont($pdf, $font, 10);  

// print text  
pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,", 50, 750); 
pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50, 730);  

// add an image under the text  
//$image = pdf_open_image_file($pdf, "jpeg", "shakespeare.jpg"); pdf_place_image($pdf, $image, 50, 650, 0.25);  

// end page  
pdf_end_page($pdf);  

// close and save file  
pdf_close($pdf);  
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:44:29+00:00Added an answer on May 14, 2026 at 4:44 am

    The question and title don’t quite seem to match, but you might be looking for the Content-Disposition header. When you send that header with a resource like a PDF, you’re recommending to the browser what to do with the resource — save it to a file or render it inline (e.g., in a window).

    For instance, to suggest that the browser offer to save the file locally:

    Content-Disposition: attachment; filename=foo.pdf
    

    whereas to suggest it should try to render the content inline:

    Content-Disposition: inline; filename=foo.pdf
    

    The browser can still do whatever it wants, but major browsers take the hint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying out the following query: SELECT A,B,C FROM table WHERE field LIKE 'query%'
I am trying out moq and I'm running into a problem with the following
I'm trying to figure out what the following line does exactly - specifically the
I'm trying to find out how to get the following constraint information from a
I have been trying out the NameValueDeserializer from MVCContrib, which will take a IList
I'm trying out the DateTime.TryParseExact method, and I have come over a case that
I'm trying to run the following code but unfortunately facing Error problems package jskypeexample;
I have the following code which uses the WWW::Mechanize and HTML::TableExtract modules. Everything works
I'm currently trying out db4o (the java version) and I pretty much like what
I am trying out the debugger built into Zend studio . It seems great!

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.