Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Bates Stamping Question
  FAQ FAQ  Forum Search   Register Register  Login Login

Bates Stamping Question

 Post Reply Post Reply
Ken_SF View Drop Down

Joined: 01 Nov 19
Location: Novato, Ca USA
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ken_SF Quote  Post ReplyReply Direct Link To This Post Topic: Bates Stamping Question
    Posted: 01 Nov 19 at 3:08PM

Does anyone know if there is an 'official' way to bates stamp (serialize individual pdf pages with a numeric (and possibly a prefix or suffix))?

I am trying to bates stamp some already-existing PDF documents with multiple pages.

I was able to do this using the DrawText function in Quick PDF Library (function written for powerbasic is shown below).

The problem I am having is that my program doesn't erase bates stamping on pages created by third party programs.  My experience is, from using a few third party bates stamping programs, is that stamping with one program erases the bates stamp added with another, so they all seem to be adding serialized page numbers using the same technique and that appears to be something different than using drawtext.

Here is the function I am using, in case someone needs to add something that looks like bates stamping.  I did have to fiddle a bit with the location (note where I had to add 150 to the page height) to get the text to draw in the lower right hand corner of the page. It would be good to understand why that extra + 150 was needed.

Thanks in advance.



dplLoadFromFile( gLibInstance1&,"sample1_bates.pdf","")
myid = dplAddStandardFont( glibinstance1&,4)

FOR i = 1 TO dplpagecount(gLibInstance1&)

  dplSelectPage( gLibInstance1&,i)

  dplNormalizePage( gLibInstance1&,0)

  dplSetOrigin(gLibInstance1&,1)  'Specifies which page corner to use for the origin: 0 = Bottom left (default), 1 = Top left, 2 = Top right, 3 = Bottom right, Anything else = Bottom left


'DPLFontType(int InstanceID)  '

'selectfont: Select one of the fonts which have been added to the selected document. The FontID must be a valid ID as returned by one of the Add*Font functions or returned by GetFontID .


 dplSetTextSize(gLibInstance1&,12) 'Set the size of the text to use for any subsequently drawn text. The text size is always measured in points, even if the measurement units have been changed with SetMeasurementUnits.
 dplSetTextColor(gLibInstance1&,1,0,0)   'sets text color to red.   NOTE : Each color component has a range of 0.0 to 1.0   and not 0 to 255 like many other libraries.

 ph = dplPageWidth(gLibInstance1&)
 pw = dplPageHeight(gLibInstance1&)

'for some reason I had to use 70% of pw to get correct width and + 150 to get correct vertical location on bottom of page (else was too high or too far to right to be visible)
  dplDrawText( gLibInstance1&,pw *.70 ,ph + 150,"pg1 " & FORMAT$(i)) 'pw - 30, ph - 20, "Page" +  format$(i))

dplSaveToFile( gLibInstance1&,"newfile.pdf")

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group

Joined: 29 Oct 05
Status: Offline
Points: 3151
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 01 Nov 19 at 3:22PM
Hi Ken,

additionally to NormalizePage you can use CombineContentStream in cases if you don't see your numbers.
What i couldn't find is the SetMeasurementUnits (this could fix your issue?):

Cheers and welcome here,

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store