Solved

Print external file with flash

Posted on 2006-10-31
3
1,427 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 500 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

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

724 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