flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Printing at a set DPI
Date Wed, 29 Jan 2014 21:50:15 GMT
I'm definitely not the expert on printing, but in my limited experience, after the call to
flexprintjob.start() you now know the page size.  IIRC, the page size often has an unexpected
size.  Like if you think you've used the PrintDialog to set up a 300 dpi print on an 8.5x11
inch page, you don't get a page size of (300x8.5 by 300x11). But I could be wrong about that.
 But I don't think it is 72*8.5 by 72x11.  Or is it?

IIRC, the next step is to generate a display object to pass to flexprintjob.  If you generate
a display object that is larger than the page size, it will get clipped or print on multiple
pages.  If you scale the children being put in this display object, then it should print with
the scaled child.  What I don't know is if that scaling will do the right thing for a bitmap.

-Alex



From: jude <flexcapacitor@gmail.com<mailto:flexcapacitor@gmail.com>>
Reply-To: "users@flex.apache.org<mailto:users@flex.apache.org>" <users@flex.apache.org<mailto:users@flex.apache.org>>
Date: Wednesday, January 29, 2014 12:58 PM
To: "users@flex.apache.org<mailto:users@flex.apache.org>" <users@flex.apache.org<mailto:users@flex.apache.org>>
Subject: Re: Printing at a set DPI

It does but I'm not sure how that would help. Also, it sends it after you send the job to
the printer. The whole thing is somewhat confusing. In Photoshop you can specify the width,
height and DPI of a document before you even start. Then later when you are ready to print
the print dialog shows the width and height and DPI. If you change the scale or width or height
in the print dialog the DPI also changes. For example, it scaled a large image to fit the
page and it went from 72DPI to 176DPI.

Then in the OS print dialog, nestled 3 layers deep in the menus, there's an option to change
the print quality (DPI). There's fast draft, fast normal, normal, automatic, best and maximum
DPI. If you dig deeper you can check the printer settings and it will show a DPI value for
the preset.

[Inline image 3]


Here's the code I'm using:

var printableObject:IUIComponent;
var flexPrintJob:FlexPrintJob = new FlexPrintJob();
var printJobStarted:Boolean = flexPrintJob.start();
// after call to start you can get the pageWidth and pageHeight
// log.info<http://log.info>("Print width and height: " + flexPrintJob.pageWidth + "x"
+ flexPrintJob.pageHeight);
flexPrintJob.addObject(printableObject, FlexPrintJobScaleType.MATCH_WIDTH);
flexPrintJob.send();

What I want to know is if somewhere along the line I can say I'd prefer to print this at 300
dpi vs 72dpi (screen)? If I supply it with an object that is twice as large as the page size
does that double the DPI? Sorry for the plethora of questions.

On Tue, Jan 28, 2014 at 4:59 PM, Alex Harui <aharui@adobe.com<mailto:aharui@adobe.com>>
wrote:
I thought PrintJob returned information about page width/height.  And I
thought that was controlled by the print settings in the print dialog.

-Alex

On 1/28/14 10:42 AM, "jude" <flexcapacitor@gmail.com<mailto:flexcapacitor@gmail.com>>
wrote:

>Is there a way to print something at a certain DPI with the PrintJob or
>FlexPrintJob classes? From what I've read so far it will print at the
>resolution of the screen. Also, when I print in vector (not printAsBitmap)
>certain display objects lose their backgrounds. For example, if there is a
>Spark Button, the gradient doesn't show up.



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message