Lissa Explains it All:  Web Design Forums  

Go Back   Lissa Explains it All: Web Design Forums > Web Site Help > HTML Help

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2011, 07:05 PM
rob_w rob_w is offline
n00bzilla
 
Join Date: Aug 2011
Posts: 2
rob_w is on a distinguished road
Best way to print embeded pdf ?

Hi all, I'm relativity new to HTML and am teaching myself as I go. At the moment, I'm wanting to print an embedded pdf and am not having much luck...


I have the pdf file hosted on my server and am using an iframe to display it.

I want to have a graphic image that acts as a button that, when clicked will print only my embedded pdf.

Here's what I have so far...

For the pdf...
<iframe src="my_pdf.pdf" width="1150" height="800></iframe>

For the print button...
<a href="javascript:window.print();"><img src="mysite.com/print_image.png" width="175" height="75" hspace="20" /></a>



The pdf displays fine on the website, and I can use the adobe pdf toolbar to print it, but I'd really like a separate button to print...
Does anyone have any ideas to print the embedded pdf content ?
Reply With Quote
Sponsored Links
  #2  
Old 08-02-2011, 03:54 AM
Lissa's Avatar
Lissa Lissa is offline
Explains it All
 
Join Date: Jul 2000
Location: The Dance Studio!
Posts: 8,350
Lissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud ofLissa has much to be proud of
I'm not sure exactly how you're using it, but I don't allow embedded pdf files to be shown for this reason:

(from Wikipedia)

Viruses and exploits
PDF attachments carrying viruses were first discovered in 2001. The virus, named "OUTLOOK.PDFWorm" or "Peachy", uses Microsoft Outlook to send itself as an attachment to an Adobe PDF file. It was activated with Adobe Acrobat, but not with Acrobat Reader.[67]
From time to time, new vulnerabilities are discovered[68] in various versions of Adobe Reader, prompting the company to issue security fixes. Other PDF readers are also susceptible. One aggravating factor is that a PDF reader can be configured to start automatically if a web page has an embedded PDF file, providing a vector for attack. If a malicious web page contains an infected PDF file that takes advantage of a vulnerability in the PDF reader, the system may be compromised even if the browser is secure. Some of these vulnerabilities are a result of the PDF standard allowing PDF documents to be scripted with JavaScript. Disabling JavaScript execution in the PDF reader can help mitigate such future exploits, although it will not provide protection against exploits in other parts of the PDF viewing software. Security experts say that JavaScript is not essential for a PDF reader, and that the security benefit that comes from disabling JavaScript outweighs any compatibility issues caused.[69] One way of avoiding PDF file exploits is to have a local or web service convert files to another format before viewing.[70]
On March 30, 2010 security researcher Didier Stevens reported an Adobe Reader and Foxit Reader exploit which runs a malicious executable if the user allows it to launch when asked.[71]

I think linking to the pdf file would be the best solution.
__________________
"We should consider every day lost on which we have not danced at least once."
Ś Friedrich Wilhelm Nietzsche

Become a
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
on Facebook!
Reply With Quote
  #3  
Old 08-02-2011, 02:05 PM
rob_w rob_w is offline
n00bzilla
 
Join Date: Aug 2011
Posts: 2
rob_w is on a distinguished road
The pdfs I'm displaying are things like permits and applications.

This is going into a kiosk that will be running a web based package, so the only pc that should ever access the page with the pdf is the one in the kiosk ( unless I'm doing testing on my pc )
Reply With Quote
  #4  
Old 08-05-2011, 07:26 AM
AcidMan00Agent AcidMan00Agent is offline
Propellerhead
 
Join Date: Aug 2005
Posts: 59
AcidMan00Agent is on a distinguished road
Rob, you will want the following, most-likely

Code:
<a href="my_pdf.pdf" onclick="window.print();return false">Print File</a>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Perl Grammar Corrector iTom User Submitted Tutorials 4 04-15-2007 02:41 PM
Print CSS and IE on Windows dzinr38 CSS 1 10-08-2005 05:27 PM
Displaying table data files in a loop Anarchist Advanced Programming 0 11-05-2004 08:53 PM
Email Form in Flash Gadget Flash 8 04-09-2004 06:14 AM
FormMail aisuruneko Advanced Programming 26 11-27-2003 01:47 PM


All times are GMT. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.