?
Solved

html headers for a pdf file

Posted on 2006-03-27
5
Medium Priority
?
942 Views
Last Modified: 2008-02-26
I have some python cgi that emits a pdf file.  I think I need a few lines of html to start it out.  The idea if for the pdf file to appear on the browser.  Please advise.
0
Comment
Question by:astar666
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:Irwin Santos
ID: 16305858
<html>
<head>
<title>My PDF</title>
</head>
<body>
<a href="myfile.pdf">My PDF File</a>
</body>
</html>
0
 
LVL 30

Expert Comment

by:Irwin Santos
ID: 16305862
where myfile.pdf is YOUR pdf filename
0
 
LVL 14

Accepted Solution

by:
huji earned 750 total points
ID: 16305884
I think what you are looking for is called "HTTP header" and not "HTML header". I'm not familiar with python, but in general the HTTP header required for making the browser understand that the dynamic content it is receiving is a PDF file is :

Content-type: application/pdf

You may need to add a semicolon or a \n at the end, perhaps.
There are times when you need to use Content-Type instead of Content-type. I don't know if this applies to python or not.
Wish I can help
Huji
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16306496
Huji has it right.  Depending on how python handles line printing (I assume it handles it the same way as Perl), you will need the newline (\n) in there.  No semi-colon IIRC.
0
 
LVL 14

Expert Comment

by:huji
ID: 16308667
Glad to be of assistance!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

840 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