How to render PDF from Local File System

Avatar

19-08-2008

Hi,

Our code to render PDF form is as follows

____________________________________________________________________________________________________________________________________

Properties connectionProps = new Properties();

connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_SOAP_ENDPOINT, "http:\\end point url");

connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);

connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebSphere");

connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "admin");

connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");



ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

FormsServiceClient formsClient = new FormsServiceClient(myFactory);



String formName = "/ManualGEAC.pdf";

byte[] cData = "".getBytes();



Document oInputData = new Document(cData);

PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();

pdfFormRenderSpec.setCacheEnabled(new Boolean(true));

URLSpec uriValues = new URLSpec();



uriValues.setContentRootURI("http://10.145.86.201:9080/PANBaseApp/forms");



FormsResult formOut = formsClient.renderPDFForm(

formName, //formQuery

oInputData, //inDataDoc

pdfFormRenderSpec, //PDFFormRenderSpec

uriValues, //urlSpec

null //attachments



Document myData = formOut.getOutputContent();

_____________________________________________________________________________________________



In the above snippet the setting of ContentRootUrl is not working. At the given line :

_____________________________________________________________________________________________

uriValues.setContentRootURI("http://10.145.86.201:9080/PANBaseApp/forms");

_____________________________________________________________________________________________



Can anybody help me to set the content root url as the local file path of the Pdf form.



Thanks,

Saravanan

Replies

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

21-08-2008

You can put file:///c:/myfolder/forms



Jasmin