I am trying to add a web page to a site that will open in pdf format so viewers on the site can print the page how do I do this. I am using dreamweaver 8 for designing the site plus I am new to all this so any ideas would be appreciated.

Dani AI

Generated

— good question. and have the basics covered, but here are practical options and gotchas that make PDFs useful and predictable for printing from a Dreamweaver-built site.

Embedding (inline view)

<object data="/path/to/your-file.pdf" type="application/pdf" width="100%" height="800">
  <p>This browser does not display PDFs inline. Use your browser's save/open controls to view the file.</p>
</object>

The <object> approach shows the PDF inside the page on most desktop browsers. It does not guarantee the same behavior on mobile devices or very old browsers.

Force download from the server

<IfModule mod_headers.c>
  <FilesMatch "\.pdf$">
    Header set Content-Disposition "attachment"
  </FilesMatch>
</IfModule>

This .htaccess snippet (requires mod_headers) tells browsers to download the PDF instead of opening it inline. Alternatively serve the file through a small PHP script that sends a Content-Disposition: attachment header and then readfile() the PDF to force download.

Print reliability and Dreamweaver notes
Dreamweaver 8 does not export pages to PDF itself. To create the PDF you can use the browser Print -> Save as PDF, Adobe Acrobat's web conversion, or server tools (wkhtmltopdf, Puppeteer) for automated generation. For consistent print output across devices embed fonts in the PDF and test margins. If you want full in-browser control of rendering and printing, consider using PDF.js for a consistent viewer. See MDN for details on embedding HTML elements like <object>: object element.

Caveats: browser PDF viewers differ, mobile behavior varies, and some hosts restrict header changes. Test on the actual hosting environment and on the browsers your audience uses.

Recommended Answers

All 2 Replies

I know nothing about Dreamweaver, sorry. There is no magic to adding a PDF to your site. You simply upload it to your server as you would any other file. When the user browses to it, they either view or download the PDF depending on their system configuration.

You simply link to it like you would a web page.

<a href="document.pdf">PDF Document</a>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.