?
Solved

how to use printjob in adobe cs3

Posted on 2011-09-30
5
Medium Priority
?
232 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 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