Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 424241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:15:37+00:00 2026-05-12T19:15:37+00:00

//I can get the right margins by defining a rectangle and giving it the

  • 0

//I can get the right margins by defining a rectangle and giving it the following dimensions:

var rect1:Rectangle = new Rectangle(0, 0, 792,612); 

//When the print button is pressed the following code executes using the dimensions defined by rect1:

prntCover_btn.addEventListener(MouseEvent.CLICK, printCover);

function printCover(evt:MouseEvent):void {
    front_mc.visible = false;
        var myPrintJob:PrintJob = new PrintJob();
        var options:PrintJobOptions = new PrintJobOptions();
        options.printAsBitmap = true;
        front_mc.scaleX = 1;
        front_mc.scaleY = 1;
        myPrintJob.start();
        myPrintJob.addPage(front_mc, rect1, options);
        myPrintJob.send();

    } 

//U.S.paper is 792 = 11.5 inch wide paper. Would like to use A3 size so I did this after the line myPrintJob.start();

var margin_height:Number = (myPrintJob.paperHeight - myPrintJob.pageHeight)/2;
var margin_width:Number = (myPrintJob.paperWidth - myPrintJob.pageWidth)/2;

This is not working to place the mc correctly on the page. This is all the Adobe help provides. Also Googled and tried different variations but no success. Can anyone help?

Thanks in advance for any insight into this.

Annie

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:15:37+00:00Added an answer on May 12, 2026 at 7:15 pm

    You could clarify the question a bit because it is a bit unclear what you’re trying to achieve… if I understood correctly, you probably want to print something in the middle of a larger paper.

    You can get the paper size the user chose only after calling PrintJob.start() so you’ll have to define the printArea parameter after that. As the printArea defines a rectangle relative to the DisplayObject being printed, in order to center the DisplayObject you’ll have to make sure that the DisplayObject is in the center of the rectangle;

    var myPrintJob:PrintJob = new PrintJob();
    var options:PrintJobOptions = new PrintJobOptions();
    options.printAsBitmap = true;
    front_mc.scaleX = 1;
    front_mc.scaleY = 1;
    myPrintJob.start();
    
    var marginWidth:Number = (myPrintJob.pageWidth - front_mc.width) / 2;
    var marginHeight:Number = (myPrintJob.pageHeight- front_mc.height) / 2;
    var rect:Rectangle = new Rectangle(-marginWidth, -marginHeight, myPrintJob.pageWidth, myPrintJob.pageHeight);
    
    myPrintJob.addPage(front_mc, rect1, options);
    myPrintJob.send();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this must be simple but I can't get it right... I have
Ok, if I have this right, my code can get cookies at a specific
How can you get castle Windsor to choose the right implantation of a interface
can't seem to get the syntax right in order to pass the AttID variable.
I can get easily see what projects and dlls a single project references from
I can get both System.Net.Mail and System.Web.Mail to work with GMail, but I can't
Logging can get complicated, quickly. Considering that you have some code, how do you
I can get the executable location from the process, how do I get the
I can get simple examples to work fine as long as there's no master
I can get the element like this $(#txtEmail) but I'm not sure how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.