Page 1 of 1

Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 9:49 am
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

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 8:52 pm
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.

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 9:02 pm
by visual approvals
Ok...When will the editor SDK be available?

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 9:08 pm
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

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 11:31 pm
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

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 11:40 pm
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?

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 11:43 pm
by visual approvals
any update on when the 'editor" sdk will be available?

Re: Stamping Multiple Pages of a pdf

Posted: Wed Apr 16, 2014 11:49 pm
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

Re: Stamping Multiple Pages of a pdf

Posted: Thu Apr 17, 2014 12:12 am
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.

Re: Stamping Multiple Pages of a pdf

Posted: Thu Apr 17, 2014 12:27 am
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:

Re: Stamping Multiple Pages of a pdf

Posted: Thu Apr 17, 2014 2:22 am
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.

Re: Stamping Multiple Pages of a pdf

Posted: Mon Apr 28, 2014 8:20 am
by visual approvals
HI ..I have to ask :D ..any closer to getting a beta of the new editor SDK? :!:

Re: Stamping Multiple Pages of a pdf

Posted: Mon Apr 28, 2014 10:52 am
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