hi, if i wanna make a pdf file attached to my website so people can look at it just like they are looking at a pdf file that they should be able to scroll up and donw, save the pdf, in short, just like they are using any pdf program , ,, i hope you know what i mean.

question is, do i just simply attach a pdf file like to attach an image? or there is something i need to know. thanks

Dani AI

Generated

asked whether a PDF can be attached like an image. A plain file link will let most browsers either open the PDF in their built‑in viewer or download it, depending on the browser and server headers. In‑page embedding is possible but browser behavior (toolbars, print/save buttons, scaling) varies across platforms — which is what ran into and what hinted at for older setups.

Practical approaches to consider: serve the PDF with Content-Type: application/pdf and, if in‑browser viewing is desired, Content-Disposition: inline; filename="file.pdf" (server header) — see the MDN note on this header (Content-Disposition). For embedding, use a standard wrapper such as <object> or <iframe> with a downloadable fallback:

<object data="/files/doc.pdf" type="application/pdf" width="100%" height="600">
  <p>PDF not viewable. <a href="/files/doc.pdf">Download PDF</a>.</p>
</object>

For a consistent UI (toolbar, print, save) across browsers and devices, use a client viewer like PDF.js (pdf.js demo). If the PDF is hosted on another domain, ensure appropriate CORS headers are set. Test on desktop and mobile (iOS Safari often hands PDFs to a native app) and verify authentication, Content-Type, and caching are configured correctly.

hi, if i wanna make a pdf file attached to my website so people can look at it just like they are looking at a pdf file that they should be able to scroll up and donw, save the pdf, in short, just like they are using any pdf program , ,, i hope you know what i mean.

question is, do i just simply attach a pdf file like to attach an image? or there is something i need to know. thanks

just in case anyone needs to know:
<embed src="example.pdf" width="xxx" height="xxx"></embed>

Embed is a nonstandard IE extension. It is deprecated.

just in case anyone needs to know:
<embed src="example.pdf" width="xxx" height="xxx"></embed>

Hi,
I need also same thing in IE but here i am getting menu also like printer, save options

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.