Author Topic: stamp datamatrix  (Read 9641 times)

0 Members and 1 Guest are viewing this topic.

lkaiser

  • Newbie
  • *
  • Posts: 12
stamp datamatrix
« on: February 16, 2016, 12:24:43 PM »
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

  • Administrator
  • *****
  • Posts: 918
Re: stamp datamatrix
« Reply #1 on: February 16, 2016, 08:22:45 PM »
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

  • Newbie
  • *
  • Posts: 35
Re: stamp datamatrix
« Reply #2 on: February 22, 2016, 12:36:25 AM »
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

  • Administrator
  • *****
  • Posts: 918
Re: stamp datamatrix
« Reply #3 on: March 11, 2016, 12:24:30 AM »
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

  • Newbie
  • *
  • Posts: 12
Re: stamp datamatrix
« Reply #4 on: April 03, 2016, 07:22:08 PM »
Great job !
Does the API will integrate these stamping features ?
for stamping text, barcode, picture on the fly

RTT

  • Administrator
  • *****
  • Posts: 918
Re: stamp datamatrix
« Reply #5 on: April 04, 2016, 01:36:25 AM »
Does the API will integrate these stamping features ?
for stamping text, barcode, picture on the fly

The next release will not contain any new API features related to this, but for sure this is something I'm going to implement in further releases.

With the possibility to pass dynamic data from the command line, to specify the text or barcode data, and using the method conrade.drake explained in a previous reply, to replace the image file referred in the stamp template, you already have the possibility to stamp text, barcodes, images and PDF pages, dynamically.