PDA

View Full Version : print PDF'S from within flash?


Dovey
06-05-2007, 02:54 PM
Hi folks!

right! im currently working on building an interactive CD ROM using flash, what i'd like to do is have links in sections of the CD ROM that allow you to print PDF documents. Is this possible? and if so how do i go about doing it? I've looked all over on google but can't seem to find any answers?

Thanks :)

Dovey
06-05-2007, 04:40 PM
or have a link that opens up the adobe viewer in a sperate window, from which you can print the document

cheers

_Aerospace_Eng_
06-05-2007, 08:31 PM
Just use getURL() to open a page and then use window.frames['pdfhold'].print() and the page would look like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
* {
margin:0;
padding:0;
border:0;
height:100%;
}
html, body {
overflow:hidden;
}
</style>
<script type="text/javascript">
window.onload = function()
{
window.frames['pdfhold'].print();
}
</script>
</head>

<body>
<iframe src="your-pdf-here.pdf" name="pdfhold" id="pdfhold" width="100%" height="100%" scrolling="auto" frameborder="0"></iframe>
</body>
</html>

Dovey
06-06-2007, 11:33 AM
Hi Aero and thanks for your reply, what if someone using the CD ROM has no web browser on the computer they are using? Is there a way to add the adobe viewer to the CD incase they don't already have it installed, which would then appear when the links are clicked on the CD to show the PDF Doc's? or am i just talking rubbish?

Its mean't to be a stand alone CD with all the files needed already on the disk (no need for a web browser etc)

_Aerospace_Eng_
06-07-2007, 02:34 AM
I see. Then still just use getURL and link directly to the pdf file. Tell them something along the lines of "If you can see the file then you do not have Acrobat Reader installed. Click here to install it. Then the installer starts. Just have the installer application on the CD. Though a computer without a browser seems a bit unrealistic.

Dovey
06-07-2007, 10:40 AM
Thanks Aero, i'll give that a try and see how it works out. I know what your saying about the browser but i'm just trying to cover all angles. Thanks for your help, its much appreciated!