Project

General

Profile

Feature #681

(callback)result of print/save action

Added by Marc Boegem about 11 years ago. Updated about 5 years ago.

Status:
Parked
Priority:
Normal
Category:
velocity
Target version:
-
Start date:
04/03/2013
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

Would it be possible to have a callback with result, or just the result of the actual print / save action of the viewer?
I have created a full custom preview popup with print/save buttons that trigger viewer.print() / viewer.doSave()
Problem is that I'd like the popup to close only after clicking the actual print/save button in the print/fileSave dialog (so not when the user clicked 'cancel')

So if there could be some kind of function like 'isPrinted()' / 'isSaved' maybe even as result in a callback that would be a great help.
I don't know if this is even possible as I know you use the native java print/save dialogs

History

#1

Updated by Patrick Talbot about 11 years ago

I could call back a Servoy function after I've send the print job the data, but the Native PrintJob simply doesn't tell me when it starts (it could be queued) or ends printing/saving my document for real, nor whether the result was successful or not...
So I can not give you a 'isPrinted' or 'isSaved' function (actually Java wouldn't even know if the user chose to print or save to disk, that's the purpose of the Native driver to abstract that part entirely).

So a callback would only be indicative that the Java part of the process is finished and the native part has started, with no indication as to a result or when the document will print or save.

That would allow you to close your window though, what do you think?

#2

Updated by Marc Boegem about 11 years ago

From what I understand is you can callback when the job is handed over to the native part.
But isn't that what the current callback parameters are doing?

Currently I just close the preview popup as soon as the native dialog windows are closed (so either print/saved or canceled)
What I do want to prevent is to have my popup being closed when the user selects 'cancel'.

#3

Updated by Patrick Talbot about 11 years ago

The printCallback right now is only used in the viewer when people click on the print button and calls back a Servoy method with a PDF byte[] for you to pring as you want.

Do you use printReport() in your preview popup to print the report? If so, I could return a boolean that would tell you if the user actually clicked on the print button or canceled (the method would return just after the data has been handled to the Native side), that should do the tick for you...

#4

Updated by Marc Boegem about 11 years ago

no, I use the print() and doSave() functions from the viewer.

I keep an instance of the viewer in a form variable, so I'm able to zoom in/out, print / save etc.

#5

Updated by Patrick Talbot about 11 years ago

Hum... so this definitely needs a callback (or 2) because this happens in a background thread and cannot return a result immediately.
I'll see how I can manage that at best.

#6

Updated by Patrick Talbot about 5 years ago

  • Status changed from New to Parked

Also available in: Atom PDF