|
|
 |
 |
 |
|
activePDF Toolkit - Beispiel-Code und HowTo's
Beispiel-Code:
-
Ausfüllen eines PDF-Formulars mit Daten aus einer
Microsoft Access® Datenbank
ASP /
VBS
-
Visitenkarte aus einer HTML und einer PDF Vorlage
erstellen
ASP
-
activePDF Toolkit Beispiele
CF
-
activePDF Toolkit Cold Fusion MX Wrapper
CFMX
-
Combine input pages into a multi-up output using
StitchPDF VBS
-
Dynamically generate a Table of Contents page during
Merge VBS
| VB.NET
| ASP
-
Simple script for testing Toolkit VBS
-
Merge multiple PDFs into one VBS
| ASP
| CF
| PHP
-
Populate a PDF form field with text VBS
| ASP
-
Populate an Existing Text Field with a Code39 Barcode
VBS
| VB.NET
| ASP
-
Generate a PDF form field using Toolkit 4.0
Professional VBS
| ASP
-
Extract pages from an existing PDF VBS
| ASP
| CF
-
Adding a PDF as a logo or watermark using the AddLogo
method VBS
| ASP
| CF
-
Populate a PDF form field with a image VBS
| ASP
HowTo`s:
Seitenzahlen in einem PDF-Dokument
einfügen (ASP)
Use FileMon and RegMon for
Troubleshooting
activePDF Support Tools
Deliver a PDF to the Browser
Collect the activePDF 3.5.2 Log Files
and Enable Debug Mode
Use Toolkit in .NET
Accessing Toolkit 4.0 as a reference
via COM Interop in .NET
How to Switch between Toolkit
versions and editions
Moving a Toolkit Developer or
Evaluation application to a Production machine
How do I manually locate my machine's
Ethernet MAC address for Toolkit?
Dieser Beispiel-Code wird in einer fünfseitigen
PDF-Datei ein Bild-Wasserzeichen an eine angegebene Stelle der vierten Seite
platzieren.
<%
Set TK =
Server.CreateObject("APToolkit.Object")
R = TK.OpenOutputFile(Server.MapPath("Output.pdf"))
R = TK.OpenInputFile(Server.MapPath("Input.pdf"))
R = TK.CopyForm(1,
3)
imagefile =
Server.MapPath("image.jpg")
x = 0
y = 0
width = 0
height = 0
PersistRatio =
True
TK.SetHeaderImage imagefile,
x, y, width, height,
True
R = TK.copyform(4,
4)
TK.ClearHeaderInfo
R = TK.copyform(5,
0)
R = TK.CloseOutputFile()
Response.Write "Finished"
Set TK =
Nothing
%>
nach oben
Bild und Text in ein PDF einfügen
Dieses Beispiel wird in einem vorhandenen PDF-Dokument die
Seitenzahl in der Mitte am unteren Seitenrand einfügen. Ausserdem wird ein Bild
und weiterer Text im Fussbereich angedruckt.
<%
Set TK =
Server.CreateObject ("APToolkit.Object")
R = TK.OpenOutputFile
(Server.MapPath("Output.pdf"))
strTotalPages = TK.NumPages
(Server.MapPath("Input.pdf"))
strFont = "Arial"
strFontSizeText =
"16"
strFontSizePage =
"12"
imagefile =
Server.MapPath("image.jpg")
x = 0
y = 20
width = 0
height = 0
PersistRatio =
True
TK.SetHeaderImage imagefile,
x, y, width, height,
True
TK.SetHeaderFont strFont,
strFontSizeText
TK.SetHeaderText 15, 10,
"activePDF, Inc."
TK.SetHeaderFont strFont,
strFontSizePage
strPageNumberText =
"Page %p of " & strTotalPages
strPageNumberWidth =
TK.GetHeaderTextWidth(strPageNumberText)
xt = (612
- strPageNumberWidth)
/ 2
TK.SetHeaderWPgNbr xt, 10,
"Page %p of " &
strTotalPages, 1
R = TK.copyform(strPage,
strPage)
TK.ClearHeaderInfo
R = TK.CloseOutputFile()
Set TK =
Nothing
%>
nach oben
Bild in ein Formfeld einfügen
Dieses Beispiel fügt in einem vorhandenen PDF-Dokument ein
Bild in ein Formfeld ein.
<%
Set TK =
Server.CreateObject ("APToolkit.Object")
R = TK.OpenOutputFile
(Server.MapPath("Output.pdf"))
R = TK.OpenInputFile
(Server.MapPath("Input.pdf"))
field = "image"
image = Server.MapPath("image.jpg")
flag = -996
TK.SetFormFieldData field,
image, -996
R = TK.copyform(0,
0)
R = TK.CloseOutputFile()
Set TK =
Nothing
Response.Write "Finished"
%>
nach oben
Dieses Beispiel wird zwei Logos in ein vorhandens
PDF-Dokument einfügen.
<%
Set TK =
Server.CreateObject("APToolkit.Object")
r = TK.OpenOutputFile(Server.MapPath("WithLogos.PDF"))
r = TK.OpenInputFile(Server.MapPath("10PAGEPDF.PDF"))
TK.AddLogo Server.MapPath("LOGO
1.PDF"), 1
r = TK.CopyForm(0,5)
TK.ClearLogosAndImages
TK.AddLogo Server.MapPath("LOGO
2.PDF"), 1
r = TK.CopyForm(6,
10)
TK.CloseOutputFile
Set TK =
Nothing
%>
nach oben
Erzeugen eines PDF-Dokument im
Arbeitsspeicher und Ausgabe an den Browser
Dieses Beispiel soll zeigen wie ein PDF-Dokument dynamisch generiert wird. Der
Toolkit wird das Dokument im Arbeitsspeicher generieren und an den Browser
senden.
<%
Response.Buffer =
True
Set objTK
= Server.CreateObject("APToolkit.Object")
r = objTK.OpenOutputFile("MEMORY")
objTK.SetFont "Helvetica",
15
objTK.PrintText 15, 760,
"activePDF Memory Example"
objTK.CloseOutputFile
zz = objTK.binaryImage
Response.Expires =
0
Response.Clear
Response.ContentType =
"application/pdf"
Response.AddHeader "Content-Type",
"application/pdf"
Response.AddHeader "Content-Disposition",
_
"inline;filename=Example.pdf"
Response.BinaryWrite zz
Set objTK
= Nothing
%>
nach oben
Seitenzahlen in ein
PDF-Dokument einfügen
Dieses Beispiel zeigt die
Seitennummerierung mit dem Toolkit und der SetHeaderWPgNbr Methode.
Ausserdem zeigt es, wie die erste und letzte Seite nicht nummeriert wird mit
Hilfe der ClearHeaderInfo Methode.
<%
Set objTK
= Server.CreateObject("APToolkit.Object")
r = objTK.OpenOutputFile("Numbering.pdf")
If r <>
0 Then
Response.Write
"error opening outputfile: " &
r
End If
totPages = objTK.NumPages("10PAGEPDF.PDF")
r = objTK.CopyForm(1,2)
If r <>
0 Then
Response.Write
"error on CopyForm: " &
r
End If
objTK.SetHeaderFont "Times-Bold",
24
objTK.SetHeaderWPgNbr 10,
10, "Page %p of " &
totPages, 3
r = objTK.CopyForm(3,
8)
If r <>
1 Then
Response.Write
"error on copyform: " &
r
End If
objTK.ClearHeaderInfo
r = objTK.CopyForm(9,
10)
If r <>
1 Then
Response.Write
"error on copyform: " &
r
End If
objTK.CloseOutputFile
Set objTK
= Nothing
%>
nach oben
|
 |
 |
 |
 |
|
 |

|
|