Stamping Multiple Pages of a pdf

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Post Reply
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Stamping Multiple Pages of a pdf

Post by visual approvals »

Hello

problem 1:
I need to be able to apply an annotation stamp to a range pages in a pdf.
The source image that goes to make up the annotation stamp is located on a network share (.jpg,bmp,tif or pdf).
I have asked a fellow developer to experiment and they have come up with the following script BUT it requires the stamp to be added to the local instance of the program annotation stamp collection.
For my purpose this wont work and is not desirable...Is there a way I can use a source image located on a network share to create a annotation stamp programmatically...and then use code similar to the following to stamp a range of pages

Problem 2
We have managed to get the stamping working for multiple pages but only an outline of the stamp is "stamped"
using the following...

imageStamp.StampName = stampName.Text;
imageStamp.Opacity = Double.Parse(imageOpacity.Text);
imageStamp.Position = p;

try
{
for (int i = 0; i < pages.Length; i++)
{
imageStamp.PageNum = int.Parse(pages);
imageStamp.PageNum -= 1;
string script = imageStamp.AnnotateImageStamp();
axCoPDFXCview1.RunJavaScript(script, out sResult, 0, 0);

}

}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
return;
}

The actual script is quite lengthy , and references the name of the stamp annotation in the current stamp collection of the instance of the program along with a position and opacity setting...since I need to provide a stamp from a network drive ...this wont do.

I would be very interested to look at your script for this scenario , perhaps one that just added an annotation stamp to the top left hand corner of the pdf page... I can take it from there

Can you please suggest an alterative or work around

Many thanks
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Stamping Multiple Pages of a pdf

Post by Vasyl-Tracker Dev Team »

Hi, Visual Approvals.

Yes, you are right - currently is impossible to add stamp-annotation 'directly', without adding of corresponding stamp-appearance into application's global storage with all known stamp-appearances.
For example when you want to add stamp on the pages by java-script - you may use only one way:

Code: Select all

doc.addAnnot({AP: "<UniqueIdOfRegisteredStampAppearance>", ...});
Also, currently is impossible to add/remove programmatically the custom stamp-appearances.

You will be able to do it using the new Editor SDK..

Small tip for you: you can get the value for 'AP' property from our drop-down list of stamps on toolbar. You can show it in tooltips on items when Ctrl key is pressed...

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.
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

Ok...When will the editor SDK be available?
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

Is it possible to get a list of the global custom annotation stamps programmatically? I would need both the display name and the ID
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Stamping Multiple Pages of a pdf

Post by Vasyl-Tracker Dev Team »

Is it possible to get a list of the global custom annotation stamps programmatically? I would need both the display name and the ID
Sorry, no way for it currently..
Can you use watermarks instead of stamps? If yes - then you may use our other PDF-Tools SDK, look to PXCp_AddWatermark() function and you will be able to place custom pictures on pages..

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.
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

Hmm...seems there is a way...I would need to parse the stamp pdf file stored under the users app setting ...the data is prefixed with a /Name tag
there are some hairs on this approach but it might work.
what do you think?
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

any update on when the 'editor" sdk will be available?
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Stamping Multiple Pages of a pdf

Post by John - Tracker Supp »

Hi, we are looking to release this sometime in the next 10-12 weeks if all goes to plan - the SDK itself is 99% finished - but there remains a substantial Help document and coding examples to prepare and test in a variety of languages (C/C++, VB, .Net etc) - so this is a preliminary 'estimate' and not guaranteed.

HTH
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
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Stamping Multiple Pages of a pdf

Post by Vasyl-Tracker Dev Team »

I would need to parse the stamp pdf file stored under the users app setting ...the data is prefixed with a /Name tag
It is possible but some notes: stamp-collections - are special pdfs. All identifiers of of stamps are located in:

Code: Select all

Root : Dictionary
     Names : Dictionary
          Pages : Dictionary
               Names : Array (NamedTree)
                     0. "<IdOfStamp1>=<Title2>" : String
                     1. <reference to page with <IdOfStamp1>>
                     2. "<IdOfStamp2>=<Title2>" : String
                     3. <reference to page with <IdOfStamp2>>
                     ...
To get information from Root/Names/Pages/Names array you must use special API that 'understands' the pdf-format correctly an interprets the native pdf-data as tree of dictionaries/arrays/values. Any other way will be incorrect..

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.
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

Thanks...complicated but doable. we have such an api...not sure it worth the effort at this point :) as we are still not able to create a stamp appearance on the fly

eg We need to be able to apply stamps which remain interactive..they can be repositioned... which may have the current date and time plus some additional data from our database displayed in the stamp.

(of course we could apply such a stamp by coping the current pdf, adding such a stamp and then re-opening a new pdf with the stamps....Im not fond of this work around)

Any Chance of getting access to the beta program of editor...It would give me an opportunity to ascertain whether we should continue using the tracker product as the ability to interact programmatically with the stamp appearance is critical to our app. Every thing else checks out really well :D but for this...missing feature :shock:
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Stamping Multiple Pages of a pdf

Post by John - Tracker Supp »

We will be posting as soon as we have some 'skeleton' doc's and sample available - but I am afraid it will be a few weeks yet.
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
visual approvals
User
Posts: 33
Joined: Wed Jul 10, 2013 6:29 pm

Re: Stamping Multiple Pages of a pdf

Post by visual approvals »

HI ..I have to ask :D ..any closer to getting a beta of the new editor SDK? :!:
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Stamping Multiple Pages of a pdf

Post by Tracker Supp-Stefan »

Hello visual approvals,

I don't have any more recent news than what John posted on the 16th, but if you e-mail us at sales@pdf-xchange.com we can include your e-mail in a notification list and let you know as soon as the SDK is available.

Regards,
Stefan
Post Reply