The following code snippet illustrates how one might find some
information about a PDF document.
[C#]
Doc theDoc = new Doc();
theDoc.Read(Server.MapPath("../mypics/mydoc.pdf"));
string theVers, theNames, thePages, theOutlines;
theVers = theDoc.GetInfo(theDoc.Root, "Version");
theNames = theDoc.GetInfo(theDoc.Root, "/Names");
thePages = theDoc.GetInfo(theDoc.Root, "pages");
theOutlines = theDoc.GetInfo(theDoc.Root, "outlines");
Response.Write("Version " + theVers + "<br>");
Response.Write("Names " + theNames + "<br>");
Response.Write("Pages ID " + thePages + "<br>");
Response.Write("Outlines ID " + theOutlines + "<br>");
theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Read(Server.MapPath("../mypics/mydoc.pdf"))
Dim theVers As String,theNames As String,thePages As String,theOutlines
As String
theVers = theDoc.GetInfo(theDoc.Root, "Version")
theNames = theDoc.GetInfo(theDoc.Root, "/Names")
thePages = theDoc.GetInfo(theDoc.Root, "pages")
theOutlines = theDoc.GetInfo(theDoc.Root, "outlines")
Response.Write("Version " + theVers + "<br>")
Response.Write("Names " + theNames + "<br>")
Response.Write("Pages ID " + thePages + "<br>")
Response.Write("Outlines ID " + theOutlines + "<br>")
theDoc.Clear()
This might result in the following output.
Version /1.4
Names 12 0 R
Pages ID 618
Outlines ID 2169
|
|
|