Export a specific annot
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Export a specific annot
Is there a way to export a specific annot into a .fdf file?
Thanks
Simon
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello lidds,
Right now there is no such a possibility. Though there is an RT-5358 for this one which I will try to implement in the nearest future. This should give a possibility to specify an array of annotations that should be exported.
Cheers,
Alex
Right now there is no such a possibility. Though there is an RT-5358 for this one which I will try to implement in the nearest future. This should give a possibility to specify an array of annotations that should be exported.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Re: Export a specific annot
Thanks Alex,
This would be really appreciated and I feel it would be a really useful feature especially with a tool like mine where there are hundreds of mark-ups and having to remove them to export an annot .fdf file does take some time for the end user and code on my part.
Keep up the good work, a kick ass PDF tool.
Simon
This would be really appreciated and I feel it would be a really useful feature especially with a tool like mine where there are hundreds of mark-ups and having to remove them to export an annot .fdf file does take some time for the end user and code on my part.
Keep up the good work, a kick ass PDF tool.
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Export a specific annot
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi Support,
+1 for this
-žarko
+1 for this
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello guys,
Just finished implementing this today! This should be available from the next 353 build.
The "AnnotsList" CAB node will be added to the operation's options that is a IPXV_AnnotsList.
Cheers,
Alex
Just finished implementing this today! This should be available from the next 353 build.
The "AnnotsList" CAB node will be added to the operation's options that is a IPXV_AnnotsList.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Export a specific annot
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Re: Export a specific annot
Alex,
That's great news.
Is there any chance of getting my hands on this improvement before an initial release as this would be really amzing for my tool?
Thanks
Simon
That's great news.
Is there any chance of getting my hands on this improvement before an initial release as this would be really amzing for my tool?
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello lidds,
As the project is actively under the development and not stable, I'm afraid that you will have to wait for the next release.
Cheers,
Alex
As the project is actively under the development and not stable, I'm afraid that you will have to wait for the next release.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Re: Export a specific annot
Hi Alex,
Is there no way that you can create a branch off your master code branch so you can incorporate this change? Sorry to put pressure, but PDFXchange SDK releases are about every 4 months which is quite sometime to wait for something that could be beneficial to quite some users.
Thanks
Simon
Is there no way that you can create a branch off your master code branch so you can incorporate this change? Sorry to put pressure, but PDFXchange SDK releases are about every 4 months which is quite sometime to wait for something that could be beneficial to quite some users.
Thanks
Simon
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello lidds,
From what I know, we'll be holding a new release soon, so no 4 month waiting
Cheers,
Alex
From what I know, we'll be holding a new release soon, so no 4 month waiting
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 150
- Joined: Fri Aug 24, 2018 8:26 am
Re: Export a specific annot
is this released yet? Or do you have an estimate to when it will be?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello jusWest,
Well we are planning to hold this release in a couple of days - so should be available soon.
Cheers,
Alex
Well we are planning to hold this release in a couple of days - so should be available soon.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 150
- Joined: Fri Aug 24, 2018 8:26 am
Re: Export a specific annot
ahh, great timing, as we are in severe need for this functionality
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Export a specific annot
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Re: Export a specific annot
I notice build 353 SDK has been released.
Is it possible to give an example code of how to export individual annots?
Thanks
Simon
Is it possible to give an example code of how to export individual annots?
Thanks
Simon
-
- User
- Posts: 150
- Joined: Fri Aug 24, 2018 8:26 am
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi,
Pseudo code:
The above exports every second annotation from each page in the document.
There's, however, an issue/bug : "Link" type annotations are completely ignored - and not saved.
-žarko
Pseudo code:
Code: Select all
IPXC_AnnotsList annotsToExport = IPXC_Inst::CreateAnnotsList
for IPXC_Page aPage in sourceDocument,
for IPXC_Annotation anAnnot in aPage
if index of anAnnot MOD 2 = 0 //(so every second)
annotsToExport.Insert(anAnnot, -1 + annotsToExport.Count);
...
op.document.exportCommentsAndFields.Params.Root["Options"]["AnnotsList"].v := annotsToExport
op.document.exportCommentsAndFields.Params.Root["Options"]["ExportAnnots"].v := TRUE
...
There's, however, an issue/bug : "Link" type annotations are completely ignored - and not saved.
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello guys,
About the export logic - this is not a bug, but an inner logic - if we export annotations, the fdf format supports annotations that are not of the Link, Movie, Widget, PrinterMark, Screen and TrapNet types. All of the other formats support only the Markup annotations.
There is a flag that allows exporting Link annotations and it's called the opts["LinksOnly"]. If set to true, then operation can export links to both FDF and XFDF formats.
Cheers,
Alex
About the export logic - this is not a bug, but an inner logic - if we export annotations, the fdf format supports annotations that are not of the Link, Movie, Widget, PrinterMark, Screen and TrapNet types. All of the other formats support only the Markup annotations.
There is a flag that allows exporting Link annotations and it's called the opts["LinksOnly"]. If set to true, then operation can export links to both FDF and XFDF formats.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi Alex,
In that above (pseudo) code, even if "LinksOnly" is added and set to true - links are not exported.
EDIT: Only if XFDF is used then links (only links) are part of it (so does not work with FDF).
BUT: op.document.importCommentsAndFields does not import those links from the same document.
-žarko
In that above (pseudo) code, even if "LinksOnly" is added and set to true - links are not exported.
EDIT: Only if XFDF is used then links (only links) are part of it (so does not work with FDF).
BUT: op.document.importCommentsAndFields does not import those links from the same document.
-žarko
Last edited by zarkogajic on Thu Apr 22, 2021 11:34 am, edited 1 time in total.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello zarkogajic,
This works for me:
Cheers,
Alex
This works for me:
Code: Select all
private void exportCommentsAndFieldsToolStripMenuItem1_Click(object sender, EventArgs e)
{
int nID = pdfCtl.Inst.Str2ID("op.document.exportCommentsAndFields", false);
PDFXEdit.IOperation Op = pdfCtl.Inst.CreateOp(nID);
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
input.v = pdfCtl.Doc;
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
options["FileName"].v = @"D:\ExportCommentsTest.xfdf";
options["Format"].v = "XFDF";
options["ExportAnnots"].v = true;
options["LinksOnly"].v = true;
Op.Do();
}
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi Alex,
Yes, I edited my previous post to say that it works if XFDF is used (and not FDF).
However, when importing from the same file - links not imported. By design, or?
-žarko
Yes, I edited my previous post to say that it works if XFDF is used (and not FDF).
However, when importing from the same file - links not imported. By design, or?
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello zarkogajic,
How are you importing the links?
If done from the Links pane in the End-User Edior - everything imports normally.
Cheers,
Alex
How are you importing the links?
If done from the Links pane in the End-User Edior - everything imports normally.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi Alex,
Eh, if it would be that simple - we would not have so many posts here
I'm using op.document.importCommentsAndFields having "Input" be a Core Document - so *no IPXV* thingies whatsoever.
The idea is to "copy" annotations from one Core document to another. Yes, I am primarily interested in "Link" type annotations but am playing with those two operations to see what's inside and what can be done if I would need it at a later time.
p.s.
Yes, I can copy link annotations using op.annnots.move from one Core to another Core - and that works as expected...
-ž
Eh, if it would be that simple - we would not have so many posts here
I'm using op.document.importCommentsAndFields having "Input" be a Core Document - so *no IPXV* thingies whatsoever.
The idea is to "copy" annotations from one Core document to another. Yes, I am primarily interested in "Link" type annotations but am playing with those two operations to see what's inside and what can be done if I would need it at a later time.
p.s.
Yes, I can copy link annotations using op.annnots.move from one Core to another Core - and that works as expected...
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Export a specific annot
Hello zarkogajic,
The LinksOnly value was also added to this operation. Set it to true and everything will work for you.
Cheers,
Alex
The LinksOnly value was also added to this operation. Set it to true and everything will work for you.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Export a specific annot
Hi Alex,
Thanks. Good to know.
-žarko
Thanks. Good to know.
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Export a specific annot
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 510
- Joined: Sat May 16, 2009 1:55 pm
Re: Export a specific annot
I am trying to export a list of annots, however I am getting the following error:
System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
The below code is a sample code to just export the first annot on the document as a test, however I can't for the life of me figure out what I am doing wrong why this is not exporting the annotList
Thanks
Simon
System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
The below code is a sample code to just export the first annot on the document as a test, however I can't for the life of me figure out what I am doing wrong why this is not exporting the annotList
Code: Select all
annotListExportCount = 0
For i As UInteger = 0 To Me.docPreview.Doc.CoreDoc.Pages.Count - 1
Dim page As PDFXEdit.IPXC_Page = Me.docPreview.Doc.CoreDoc.Pages(i)
Dim nCnt As UInteger = page.GetAnnotsCount()
If nCnt <> 0 Then
For j As UInteger = 0 To nCnt - 1
annot = page.GetAnnot(j)
If annot.IsMarkup Then
annotsExportList.Insert(annot, CUInt(annotListExportCount))
Exit For
End If
Next
End If
Exit For
Next
Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.document.exportCommentsAndFields")
Dim pOp As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)
Dim input As PDFXEdit.ICabNode = pOp.Params.Root("Input")
input.v = Me.docPreview.Doc
Dim fsInst As PDFXEdit.IAFS_Inst = DirectCast(Me.docPreview.Inst.GetExtension("AFS"), PDFXEdit.IAFS_Inst)
Dim destPath As PDFXEdit.IAFS_Name = Nothing
destPath = fsInst.DefaultFileSys.StringToName(MISData.Instance.TempDirectory & "\Annotations\" & activeMasterDocOID.ToString & "\" & annotLayerOID & ".fdf")
Dim output As PDFXEdit.ICabNode = pOp.Params.Root("Output")
output.v = destPath
Dim options As PDFXEdit.ICabNode = pOp.Params.Root("Options")
options("ExportAnnots").v = True
options("ExportFields").v = True
options("DestFile").v = destPath
options("AnnotsList").v = annotsExportList
pOp.Do()
Simon
-
- Site Admin
- Posts: 17949
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Export a specific annot
Hello Simon,
Can you please check if this will help:
viewtopic.php?f=66&t=26714&p=103655&hil ... ce#p103655
As this was the solution to the previous post with the same error like yours regarding protected memory!
Kind regards,
Stefan
Can you please check if this will help:
viewtopic.php?f=66&t=26714&p=103655&hil ... ce#p103655
As this was the solution to the previous post with the same error like yours regarding protected memory!
Kind regards,
Stefan