Some test text!

Stamping contentkeyboard_arrow_down


A stamp in a PDF document is analogous to applying a rubber stamp on a paper document.

PDFTron SDK benefits include:

  • Stamp PDF pages with text, images, or with other PDF pages.
  • Embed fonts and images, and copy graphical elements from one page to another.

linkStamp a PDF Page

To stamp an image to a page in a PDF document.

PTPDFDoc *doc = [[PTPDFDoc alloc] initWithFilepath: filename];
PTStamper *s = [[PTStamper alloc] initWithSize_type: e_ptrelative_scale a: 0.05 b: 0.05];

PTImage *img = [PTImage Create: [doc GetSDFDoc] filename: imagename];
[s SetSize: e_ptrelative_scale a: 0.5 b: 0.5];

//set position of the image to the center, left of PDF pages
[s SetAlignment: e_pthorizontal_left vertical_alignment: e_ptvertical_center];
PTColorPt *pt = [[PTColorPt alloc] initWithX: 0 y: 0 z: 0 w: 0];
[s SetFontColor: pt];
[s SetRotation: 180];
[s SetAsBackground: NO];

//only stamp first 2 pages
PTPageSet *ps = [[PTPageSet alloc] initWithRange_start: 1 range_end: 2 filter: e_ptall];
[s StampImage: doc src_img: img dest_pages: ps];

Stamp a PDF File
Full code sample which shows how to stamp PDF pages with text, images, or with other PDF pages and how to add new content (or watermark).

linkAbout stamping a PDF page

Stamper can be used for PDF pages with text, images, or with other PDF content in only a few lines of code. Although Stamper is very simple to use compared to ElementBuilder/ElementWriter it is not as powerful or flexible. In case you need full control over PDF creation use ElementBuilder/ElementWriter to add new content to existing PDF pages as shown in the ElementBuilder sample project.

Get the answers you need: Support


Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more