Hi,
In our application we export and import annotations in xfdf – format. We use the pdfXchangeViewer 2.5 ActiveX, build 312.1.
When the document is closed, we check the modified-flag in order to know whether there are any changes to save.
Our problem is that when a user makes a Textbox-annotation, types some text in it, and closes immedatly the document (while the textbox still has focus), the annotation is not saved. That is because the modified-flag is set after losing the focus on the texbox.
I found that as long as the texbox-annotation has focus, the annotation is not yet visible within the document. When I make a textbox-annotation, keep focus on it, open the javascript-console and execute:
console.println(this.getAnnots().length);
no annotations are found.
We want the annotion to be visible within the document before we close the document, in order to be able to save the annotation before closing.
I tried to find methods in the API that would cause to leave focus from the texbox before closing the document, so the modified flag would be set and the annotation would be noticed, but without any result. I tried ‘Flush’ but it didn’t work.
Is there a way to change the focus programmatically, or is there another way to solve this problem?
Thanx,
Arnold
Modified-flag set after losing focus on textbox annotation
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Modified-flag set after losing focus on textbox annotati
Hi Arnold.
Please details: in which way exactly user closes the document?
1. by using original pdf-viewer's UI(documents tab bar, menu command, shortcut etc.)?
2. by closing your own container, that embeds our pdf-viewer control?
3. by button on your own toolbar that calls the pdfViewerCtl.CloseDocument() routine?
...
Best
Regards.
Please details: in which way exactly user closes the document?
1. by using original pdf-viewer's UI(documents tab bar, menu command, shortcut etc.)?
2. by closing your own container, that embeds our pdf-viewer control?
3. by button on your own toolbar that calls the pdfViewerCtl.CloseDocument() routine?
...
Best
Regards.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Modified-flag set after losing focus on textbox annotati
Hello Vasyl,
No. 2: by closing our own container that embeds our pdf-viewer control. The pdf-viewer control is opened in a widget.
In order to close the document, the user closes the widget.
On closing the widget, first the annotations are extracted and saved, the control is closed (self._pdf.CloseDocument(0, PXCVA_Flags.PXCVA_NoUI);), and then the widget is closed.
regards,
Arnold
No. 2: by closing our own container that embeds our pdf-viewer control. The pdf-viewer control is opened in a widget.
In order to close the document, the user closes the widget.
On closing the widget, first the annotations are extracted and saved, the control is closed (self._pdf.CloseDocument(0, PXCVA_Flags.PXCVA_NoUI);), and then the widget is closed.
regards,
Arnold
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: Modified-flag set after losing focus on textbox annotati
Hi Arnold.
Try to call:
self._pdf.FlushDocument(0, PXCVA_Sync);
before calling of CloseDocument.
HTH.
Try to call:
self._pdf.FlushDocument(0, PXCVA_Sync);
before calling of CloseDocument.
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Re: Modified-flag set after losing focus on textbox annotati
Hi Vasyl,
Thank you, FlushDocument(0, PXCVA_Sync) works!
Before I posted this issue I tried FlushDocument, but with the PXCVA_NoUI - flag. That didn't work. With the PXCVA_Sync - flag it does.
Again, thanx a lot!
Arnold
Thank you, FlushDocument(0, PXCVA_Sync) works!
Before I posted this issue I tried FlushDocument, but with the PXCVA_NoUI - flag. That didn't work. With the PXCVA_Sync - flag it does.
Again, thanx a lot!
Arnold
- Tracker Supp-Stefan
- Site Admin
- Posts: 17910
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Modified-flag set after losing focus on textbox annotati
Glad we could help divspirit!
Cheers,
Stefan
Cheers,
Stefan