Solved

how to use printjob in adobe cs3

Posted on 2011-09-30
5
226 Views
Last Modified: 2012-05-12
Hi, how can I print a form from a flash application. Doing some research here I looked at printjob, but I don't know how to use it either.  I am using Adobe Flash CS3
I wanna be able to print the text from text fields, add titles, some text, etc...
I am using AS2

Any help, recommendation or guide would be greatly appreciated

Thanx
0
Comment
Question by:crescue
[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
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 36894480
Very simple:

_root.createTextField("textField_txt", 1, 10, 10, 200, 25);
_root.textField_txt.text = "Hello World";


var printJob:PrintJob = new PrintJob();
if (printJob.start()) {
      printJob.addPage("textField_txt", null, {printAsBitmap:true}, 1);
      printJob.send();
      delete printJob;
}
                        
0
 

Author Comment

by:crescue
ID: 36895257
I already have the form with fields and everything I want to print. I just want to send that information to the printer, and I am using the code below :
It prints fine with the exception that it prints the PRINT BUTTON too, and I would like to get rid of that button in the printout

Thanx

import mx.controls.Button;
var printBut:Button;
var my_pj:PrintJob;

printBut.onPress = function() {
    // create PrintJob object
      
   my_pj = new PrintJob();
    if (my_pj.start()) {
        if (my_pj.addPage(_root)) {   //_root
            my_pj.send();
        }
    }
};
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36895502
you can on print hide PRINT BUTTON and after printing complete set to visible true
0
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36895602
printBut.onPress = function() {
    // create PrintJob object
     
   my_pj = new PrintJob();
    if (my_pj.start()) {
          printBut.visible = false;
        if (my_pj.addPage(_root)) {
            my_pj.send();
        }
            printBut.visible = true;
    }
};
0
 

Author Closing Comment

by:crescue
ID: 36973996
Thanx
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

730 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