?
Solved

Print external file with flash

Posted on 2006-10-31
3
Medium Priority
?
1,428 Views
Last Modified: 2013-11-18
I have a button in my flash movie and I want it to print an external .pdf file.

right now this is the code I have but it is just printing the current movie.

Any help is really appreciated thank you,

on (release) {
      print("Page_01.pdf", "bmax");
}
0
Comment
Question by:paulmmalone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Expert Comment

by:AngryBinary
ID: 17885539
Flash is not capable of sending external files to your print spool on its own. This functionality is supplied by third party Flash wrappers, such as mProjector, which has a convenient method called "printDocument". If it isn't practical to purchase an mProjector license for your specific needs, you can either attempt to reproduce the document in flash and print the movie clip (using the print method or PrintJob class), or simply call the PDF up into a browser window for printing with getURL, since most users have a PDF plugin installed.

As a side note, you can print pages loaded in a separate frame via javascript. There is also an IE specific meta tag that allows you to specify an alternate page to print. While that might not be compliant enough to represent a viable solution, here is a little more info:

http://www.dynamicdrive.com/dynamicindex9/printstyle.htm

Cheers
--Randall
0
 

Author Comment

by:paulmmalone
ID: 17889147
What about dynamically bringing a jpg into flash in a movie clip.  Then printing that movie clip.
Does anyone have an action script example of this.  Please.
0
 
LVL 13

Accepted Solution

by:
AngryBinary earned 2000 total points
ID: 17891013
That should be very possible:

var pictureClip = _root.createEmptyMovieClip("pictureClip", 0);
var jpgPath = "./somePic.jpg";
var loaderListener = new Object();
var picLoader = new MovieClipLoader();
var printJob = new PrintJob();

loaderListener.onLoadError = function()
{
    trace("Error on load");
}

loaderListener.onLoadInit = function()
{
    _root.StartPrint();
}

picLoader.addListener(loaderListener);
picLoader.loadClip(jpgPath, pictureClip);

function StartPrint()
{
    if(printJob.start() && printJob.addPage(pictureClip))
    {
        printJob.send();
    }
    else
    {
       trace("Error printing!");
    }
}
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 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