PDF-ShellTools > General

stamp datamatrix

(1/2) > >>

lkaiser:
Hi RTT,

Is it possible to stamp a datamatrix on each page of a PDF file ( The value depends on the current page , the page number , date and fields read from the text of the PDF) ?
I think I should use an external javascript library to generate the datamatrix, but I don't know where to install it so that it interacts with the PDFShellTools's script.

Thank You

RTT:
The scripts API doesn't support, yet, the stamp functionality. I suppose you may create a stamp template, with a dynamic text field reference, as explained at this forum post, and use a script to calculate the text to stamp, and to call the stamp tool command line interface, passing that text in the DynCustomText parameter. Because your text changes with each page, then your script will need to do this call for each page too.

Probably more workable is to create a stamp template, with a dynamic text object, that makes reference to an external application/script, using the [x#] constant. The stamp tool will call this external application for each page set to be stamped, with the possibility to pass the current page number as a a parameter in each call, so your external application just needs to return the text accordingly to that parameter.
(I suppose a dynamic stamp constant, to call an internal script, may be handy for this type of more complex stamp tasks)

I now realize your "datamatrix" reference is about the 2d matrix barcode, so please ignore my previous nonsense response. I have this functionality of stamping barcodes in the stamp tool todo list for some time now, but I haven't implemented it yet, so there is no way to do it with the current version.

Regarding the utilization of an external script library. You will need to create a new script, under the libraries tab, and paste in it your external library code. To use it, just select that library script name from the includes button for your script. Check the attached screenshots for visual reference.

conrad.drake:
If I understand the problem correctly, there may be a work around

If you can produce your 2-D barcode as an image, a way around this would be to set up a stamp which stamps with a known image.  And then replace that image with the barcode.

Something like the following batch file fragment ....

@REM The first parameter is the file, the second the stamp;
@REM known_image is used by the stamp template to place the barcode
set this_pdf_file=%~1
set this_barcode_image=%~2

IF EXIST known_image.gif DEL known_image.gif
COPY %this_barcode_image%  known_image.gif
PDFShellTools stamp -s Template=barcode.stp %this_pdf_file%


Now being able to pass the image name in as a parameter would help

RTT:
Just finishing the integration of barcode stamps, that will debut in the next release. ;)
The barcode data can be dynamically generated, as with the text stamp, functionality now extended with the possibility to use a script output as the source of the text/data, so you will be able to easily generate and stamp the datamatrix.

lkaiser:
Great job !
Does the API will integrate these stamping features ?
for stamping text, barcode, picture on the fly

Navigation

[0] Message Index

[#] Next page

Reply

Go to full version