The following Java code example creates a
com.adobe.idp.Document
object
that is based on a PDF file named
map.pdf.
This file is located
within a web application named
WebApp
that is running
on
localhost
. This constructor attempts to set
the
com.adobe.idp.Document
object’s MIME content
type using the content type returned with the URL protocol.
The URL supplied to the
com.adobe.idp.Document
object
is always read at the side where the original
com.adobe.idp.Document
object
is created, as shown in this example:
Document doc = new Document(new java.net.URL("file:c:/temp/input.pdf"));
The c:/temp/input.pdf file must be located on the client computer
(not on the server computer). The client computer is where the URL
is read and where the
com.adobe.idp.Document
object
was created.
Creating a document based on content accessible from an URL
//Create a Document object based on a java.net.URL object
URL myURL = new URL("http", "localhost", 8080,"/WebApp/map.pdf");
//Create another Document object
Document myPDFDocument = new Document(myURL);
|
|
|