Solved

how to use printjob in adobe cs3

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now