PXC_AddLineAnnotation LNK1120 unresolved

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Wed Dec 09, 2009 9:19 pm

I'm getting a linker error when trying to use the PXC_AddLineAnnotation API.

1>PDF.obj : error LNK2001: unresolved external symbol __imp__PXC_AddLineAnnotation@28

If I dumpbin the pxclib40.dll, I do not see PXC_AddLineAnnotation exported. It is exported under the pro library:

c:\Projects\Test>dumpbin /exports pxclib40.dll | find "AddLine"

c:\Projects\Test>dumpbin /exports xcpro40.dll | find "AddLine"
11 5 00025670 PXCp_AddLineAnnotationA
12 6 00025620 PXCp_AddLineAnnotationW

Any help is greatly appreciated.

FWIW, I am trying to draw freehand annotations on a new PDF (at the time of creation), but MoveTo/LineTo simply draws over the page and cannot be undone like an annotation can. I'd love to hear of another way to do this...

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5183
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by Paul - Tracker Supp » Wed Dec 09, 2009 10:47 pm

Hi eric,

I've asked the dev team to take a look at your question. You should see something here soon.

regards
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Wed Dec 09, 2009 11:09 pm

On a related note, if I use the PDF XChange Viewer to draw on a PDF (lines, rectangles, freehand, etc), the objects are placed into the PDF as annotations.

While I'm creating a PDF using PXC, all the MoveTo/LineTo/Rect/etc functions simply draw on the canvas instead of placing the drawings into an annotation object. The symptom of this is that the lines cannot be hidden or moved in the PDF Viewer like annotation objects can be. How do I get the PXC library to draw into an annotation object rather than on the main canvas?

That's why I was going to try using the PXC_AddLineAnnotation, but maybe I'm just looking at this problem the wrong way.

Thanks,
Eric

John - Tracker Supp
Site Admin
Posts: 8213
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by John - Tracker Supp » Fri Dec 11, 2009 3:28 pm

Hi,

The PXCLIB40 library has no annotations function - you will need to use either the Viewer of the XCPRO40 library to add annotations subsequently.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Mon Dec 14, 2009 4:44 pm

The SDK includes the following defined API's, which are included in the PDF-Tools SDK Version 4.x help file under PXCLIB40 LIB Functions->Viewing/Display Options:

PXC_AddLineAnnotation
PXC_AddTextAnnotationA
PXC_AddTextAnnotationW
PXC_SetAnnotsInfo

If there isn't any annotation functionality in PXCLIB40, these should probably be removed.

I'll use the XCPRO40 functions to perform the annotation.

Thanks,
Eric

User avatar
Paul - Tracker Supp
Site Admin
Posts: 5183
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by Paul - Tracker Supp » Mon Dec 14, 2009 6:51 pm

It seems the problem is that for some reason the function _PXC_AddLineAnnotation is declared in pxclib40.dll, but was not correctly implemented in the build...

It will be fixed in the next build :-)
_________________
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Mon Dec 14, 2009 8:47 pm

I don't see any of the MoveTo/LineTo polygon drawing functions in the XCPRO40 library, so I'm once again not understanding how to draw an annotation object on a PDF. I'm effectively trying to mimic the Pencil tool in the PDF XChange Viewer. It stores the pencil-drawn lines as an annotation in the PDF. If I use the PXC_MoveTo/PXC_LineTo functions, the lines are in the PDF, but not on an annotation object.

How do I draw lines on an annotation object with EITHER library? I don't care which library I have to use, I just need to figure out how to do it correctly.

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Tue Dec 15, 2009 3:30 pm

I dug into a PDF created by PXV and noticed an object attached to the page with a Subtype of Ink. After browsing the PDF specification, I figured out this is an Ink annotation, and that's what I'm looking for. I started working with the low-level API and have managed to create my point array InkList, Rect the size of the annotation, F flag for printing, C flag for background transparency, and P for referenced page. It's been added to the Annots dictionary for the page.

Unfortunately it's not displaying. I did notice that PXV adds the object to both the global object table as well as the page, where I have just added the object to the page, but should that matter?

Are there any good examples of how to use the low-level API to create an Ink annotation object?

Lzcat - Tracker Supp
Site Admin
Posts: 727
Joined: Thu Jun 28, 2007 8:42 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by Lzcat - Tracker Supp » Tue Dec 15, 2009 5:06 pm

Can you provide us sample of your code illustrating problem, and maybe resulting file? We will investigate and give you corrected sample.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Thu Dec 17, 2009 10:02 pm

I have attached some code that should demonstrate the problem, along with three PDF files:

circle.pdf is the source that I'm trying to add an ink annotation to.

circle-drawn.pdf is the PDF produced by PDF Xchange Viewer by drawing a circle inside the box.

circle-2.pdf is the PDF generated by the attached source code. It looks like I have most of the pieces in place, but the annotation still isn't being rendered for some reason.

The Main.cpp code calls a good swath of the wrapper classes I have in PDFLib.hpp/cpp. If you have a better C++ API, I'm game to try that as well.
Attachments
example.rar
(37.29 KiB) Downloaded 160 times

Lzcat - Tracker Supp
Site Admin
Posts: 727
Joined: Thu Jun 28, 2007 8:42 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by Lzcat - Tracker Supp » Fri Dec 18, 2009 8:34 am

There are several problems in your code.

1. Main problem - Subtype must be Name, not String.

2. Minor problem - AP should be Dictionary instead of String, and it must contain N entry with correct Appearance Stream. Another option - do not set AP entry in annotation dictinary, it this case the Viewer/Reader application shoudl create appearance and display annot.

3. C entry set not background, but color of annotation line, and 0 0 0 designates black as the color, not transparent.

After fixing these issues all should work.
Victor
Tracker Software
Project manager

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

eric_hill
User
Posts: 16
Joined: Tue Mar 28, 2006 12:40 am

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by eric_hill » Fri Dec 18, 2009 3:09 pm

Hi Victor,

After switching the subtype to a name instead of a string and removing the AP string, the annotation is now showing properly.

I got the C description of transparent from (misreading) the PDF spec, section 12.5.2 Table 164 lists "0" as transparent, however that is zero elements in the array rather than a 0 value.

Many thanks for helping with this!

Eric

John - Tracker Supp
Site Admin
Posts: 8213
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: PXC_AddLineAnnotation LNK1120 unresolved

Post by John - Tracker Supp » Fri Dec 18, 2009 3:12 pm

Excellent - good news Eric.

:)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply