If printJob.start() returns false, nobody should be calling addPage()

 

I think you should be ok if you re-enable the button after
printJob.send() is called.

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of dmiramontesval
Sent: Thursday, March 01, 2007 5:05 PM
To: [email protected]
Subject: [flexcomponents] More questions about Printing, handling
printing errors

 

It seems that printing is one of the complicated topics with Flex :P

Well i am now printing my grids correctly and everything works fine,
or so i was expecting because there are some scenarios where an error
is being thrown.

1.- After the print prompt appears and you choose the printer to
print, you get control of the flex application again, if you try to
print and the printer hasn't finished, you get an error that only one
print job can be handled at the time. So how would you recommend this
error to be handled? I think that maybe deactivating the print Button
and then activating it when the printer has finished, but i don't seem
to find a way to do this last part (notify flex when the printer has
finished). Any ideas?

(This next one is not very common for the client to do it, but i felt
the curiosity of asking)
2.- When the print prompt appears i choose to print it to a file
printer (Microsoft Office Document Image Writer for example). When
doing this everything works fine, the output is printed into a .mdi
file. 

Then here comes the issue, the prompt appears and i select to print it
to a file, then i am asked for the name of the file and the location,
if i decide to cancel the printing job at this point (in the save as
prompt) Flex throws an error saying:

Error #2057: The page could not be added to the print job.
at Error$/throwError()
at flash.printing::PrintJob/addPage()
at mx.printing::FlexPrintJob/addObject()

I followed the Adobe LiveDocs example on multipage printing so the
error occurs when you add objects to the printJob, for example:

printView.showPage(DataGridPrintView.SINGLE);
if (!printView.dataGridToPrint.validNextPage) {
this.addObject(printView);
}

***printView is the component (contains the header, the PDG and the
footer) that is being added to the application's display list.

Any ideas of how can i catch this error??

These two seem to be pretty harsh so any ideas would be appreciated

 

Reply via email to