Stamping Multiple Pages of a pdf
Posted: Wed Apr 16, 2014 9:49 am
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
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