Solved

how to use printjob in adobe cs3

Posted on 2011-09-30
5
227 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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
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…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

687 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