37
activePDF Toolkit Professional Edition
aptkl4a 30405
Copyright 2005, activePDF, Inc. All Rights Reserved.
Page 30 of 553
TK.SetHeaderJPEG imagefile, x, y, width, height, True
'Copy just the fourth page with the image to the output
R = TK.copyform(4, 4)
'Clear the header info so it does not appear on subsequent pages
TK.ClearHeaderInfo
'Copy page 5 and on to the output
R = TK.copyform(5, 0)
R = TK.CloseOutputFile()
Set TK = Nothing
Stitch
This tutorial uses Toolkit to stitch a single PDF page 4-up on an 8.5 x 11 page of a new PDF. For this
tutorial, you will need a single page PDF (Named:
input1.pdf
)containing a line of text, which you can
generate by altering Example B in the Creating a PDF from Scratch tutorial.
Example Script
Set TK = CreateObject("APToolkit.Object")
r = TK.OpenOutputFile("output1.pdf")
'Stitch the single page of the input file 4-up on a single page of the output PDF.
r = TK.StitchPDF("Input1.pdf", 1, 0, 397, 306, 396, 0)
r = TK.StitchPDF("Input1.pdf", 1, 307, 397, 306, 396, 0)
r = TK.StitchPDF("Input1.pdf", 1, 0, 0, 306, 396, 0)
r = TK.StitchPDF("Input1.pdf", 1, 307, 0, 306, 396, 0)
r = TK.CloseOutputFile()
Set TK = Nothing
Form Fields - Generating and Filling
Toolkit enables you to create PDF form fields on the fly or use an existing PDF document with form
fields as a template. This tutorial provides two different examples for using Toolkit with PDF forms.
The first example covers generating a PDF with form fields on the fly; the second example covers
populating and flattening an existing form field.
Generate Form Fields on the Fly
This example uses Toolkit to generate a new PDF document with a single text field. The PDF generated
in this example can be used in the other form field tutorials.