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
Author
Message
Ken_SF View Drop Down
Beginner
Beginner


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
Hi,

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.

Ken

FUNCTION AddPageNumberPDF() AS LONG
'http://www.quickpdf.org/forum/add-page-numbers-to-existing-pdf_topic2096.htm
LOCAL myid AS LONG, i AS LONG
LOCAL ph,pw AS DOUBLE

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

FOR i = 1 TO dplpagecount(gLibInstance1&)

'https://www.debenu.com/docs/pdf_library_reference/SelectedPage.php
  dplSelectPage( gLibInstance1&,i)

'https://www.debenu.com/docs/pdf_library_reference/NormalizePage.php
  dplNormalizePage( gLibInstance1&,0)

'https://www.debenu.com/docs/pdf_library_reference/SetOrigin.php
  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

'https://www.debenu.com/docs/pdf_library_reference/Fonts.php
'https://www.debenu.com/docs/pdf_library_reference/Text.php

'DPLFontType(int InstanceID)  'https://www.debenu.com/docs/pdf_library_reference/FontType.php

'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 .

 dplSelectFont(gLibInstance1&,myid)

'https://www.debenu.com/docs/pdf_library_reference/SetTextSize.php
 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))
NEXT i

dplSaveToFile( gLibInstance1&,"newfile.pdf")
END FUNCTION



Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
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?):
https://www.debenu.com/docs/pdf_library_reference/SetMeasurementUnits.php

Cheers and welcome here,
Ingo
Cheers,
Ingo

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