Serving PDF using IE

NOTE: This is not a question but rather a thread for solutions to this problem. I hope that someone who is having this same problem in the future can find this information useful. If you have a solution you would like to share then post it here.
I have been having the same problem that many have been having with generating PDF files and returning to IE client. I have read through the many suggestions on how to do this using Java here in these forums and on the web and never really found a direct solution to my problem.
The basic advice that I have seen pretty much everywhere holds true. You must set the content type and the content length without exception. Some say you need to set the content disposition but I have not seen the need for this--it may only apply in special situations I have not yet encountered.
The problem I had was trying to serve PDFs using a struts based framework. This required my URL to look something like (http://localhost/app/report/view.do?jobId=1234567890), where /report/view mapped to an action and jobId was the report job identifier. Using the classic code below in a Struts Action fails miserably to view or save the generated PDF with an error indicating IE failed to communicate with the server.
// load pdfbytes here
response.setContentType("application/pdf");
response.setContentLength(pdfbytes.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(pdfbytes, 0, pdfbytes.length);
ouputStream.flush();
ouputStream.close();I tried many variations with the response such as changing the buffer size, setting content disposition, changing Acrobat preferences among others and nothing worked.
During my search on the web I found an article that indicated IE violates HTTP in that it defines it's own way for determining the content of a URL rather than using the response header. I believe Microsoft's web site says this is by design and not a flaw. The article also indicated that the workaround was to use Microsoft extensions. (I cannot find the article again, if I could I would post a link to it).
With this new information in hand I decided to create a test servlet that would serve an existing PDF from the local file system. The following are snippets from web.xml and the PdfReportViewServlet:
<servlet>
   <servlet-name>pdf</servlet-name>
   <display-name>PDF Report View Servlet</display-name>
   <description>Used to serve PDF reports to client once they are completed running.</description>
   <servlet-class>report.PdfReportViewServlet</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>pdf</servlet-name>
   <url-pattern>*.pdf</url-pattern>
</servlet-mapping>     
public class PdfReportViewServlet extends HttpServlet {
   public void service(HttpServletRequest request, HttpServletResponse response)
   throws IOException, ServletException {
      // Read in PDF test file
      File l_file = new File("c:/temp/test.pdf");
      FileInputStream in = new FileInputStream(l_file);
      int length = in.available();
      byte[] pdfbytes = new byte[length];
      in.read(pdfbytes);
      in.close();
      // Send response
      response.setContentType("application/pdf");
      response.setContentLength(pdfbytes.length);
      ServletOutputStream ouputStream = response.getOutputStream();
      ouputStream.write(pdfbytes, 0, pdfbytes.length);
      ouputStream.flush();
      ouputStream.close();
}Basically anything ending in "pdf" will be handled by the servlet. After deploying this code to Tomcat and typing in a test URL like (http://localhost/APP/test.pdf) it works!
I then decided to see what would happen if I changed the PDF extension from "pdf" to something else to determine if IE was using the "pdf" extension in the URI or using the content type to determine the true content (At least to prove it in my mind). I changed the following in web.xml:
<servlet-mapping>
   <servlet-name>pdf</servlet-name>
   <url-pattern>*.rpt</url-pattern>
</servlet-mapping>     Now the servlet will handle anything ending in "rpt" but will still return PDF content. The result was a bunch of gibberish that was the PDF file converted into text and displayed in IE. IE must be using the file extension in the URI to identify the content type.
Just for fun I decided to try not setting the content length to see what would happen. I reverted the web.xml file back to map to "*.pdf" and commented out the line to set content length:
      // Send response
      response.setContentType("application/pdf");
      // response.setContentLength(pdfbytes.length);
      ServletOutputStream ouputStream = response.getOutputStream();
      ouputStream.write(pdfbytes, 0, pdfbytes.length);
      ouputStream.flush();
      ouputStream.close();The darn thing worked! So I guess IE doesn't care about content length.
Hmmmm, do I even need to set the content type? I commented out the line to set content type and.....
it worked!
So my new servlet code looks like this and works fine:
      // Send response
      ServletOutputStream ouputStream = response.getOutputStream();
      ouputStream.write(pdfbytes, 0, pdfbytes.length);
      ouputStream.flush();
      ouputStream.close();Of course in my production code I will be setting content type and length because other browsers that correctly implement HTTP will require it unlike IE, at least I think they require it until future testing proves otherwise.
In conclusion, it seems that IE uses the URI to determine the content type rather than using the response header. So if you want IE to correctly recognize the content type of any target you better use the approriate extension in the URI rather than depend on the response header content type.
BTW: I was using Tomcat 5.0.14, IE 6 SP1, Win2k Pro SP4, and Acrobat 6. I have not tested this using different configurations. When I have the time I will try and perform more extensive testing.

That's great. Now try doing a POST to your URL and see if IE still likes it. Or use HTTPS. Or both POST and HTTPS. Or use GET with a really long URL and watch IE crash (This one is probably a buffer overrun). Then try those various combinations on different versions of IE with all the various patches, etc. I've given up and I just tell people to download Firefox.

Similar Messages

  • Adobe Acrobat as a server to create PDF using PDF templates and field values

    I'm writing a web page to create a PDF using fields that we ask for them in the screen.
    My idea is:
    1. Ask for field values (text values and a photo) in my web
    2. Run Adobe Acrobat to load a PDF template (PDF form) and mix with the field values
    3. Create a final PDF mixing values and template
    4. Show to document to the user in his client web browser. I guess the only way to do that is to create the PDF on a server with Adobe Acrobat Pro and send to the user browser a JPEG that will represent the  PDF: If I do this operation in the PDF visor at the client browser, the problem is that it will will be mandatory to install Adobe Acrobat in each cliente because only this visor can manage javascript.
    Can you tell me if this idea is correct? It is possible to use Adobe Acrobat on a Server to create PDF when some proccess needs?

    and what other Adobe product o procedure can we use to do that?
    I only need to create a PDF mixing PDF Templete, field values and javascript.
    Thanks for your help.

  • I'm trying to timestamp (RFC 3161) a pdf using my own timestamp server hardware but always get an error: "Certificate invalid for use" ...

    I'm trying to timestamp (RFC 3161) a pdf using my own timestamp server hardware but always get an error: "Certificate invalid for use" (Original text - pt_BR:O certificado não é válido para uso). How can I get more info on what I'm missing or whats wrong with the certificate?

    Which Acrobat version are you using? Do you use "Document Timestamp" command? If so, do you get this error during the signing process and the signature is not created or signature is created and you get this error when it is validated? If the latter you can open signature properties, click on the "Advanced Properties" and in the next dialog on timestamp's "Show Certificate". If you get this error during the signing process do you get an alert that shows some cryptic info with a number? If you do provide the content of this alert.
    Also which Acrobat version (including minor) are you using?

  • I am unable to create pdf using adobe printer to a redirected folder on a server running windows server 2003

    I am unable to create pdf using adobe printer to a redirected folder on a server running windows server 2003

    In the app-server-ant.xml file, as indiacted in the error message i am getting, at line 145 it is suppose to get the path to \bin\asadmin.bat from the value of a paramater called 'asadmin'. This value is being set in the beginning of the file.
    The parameter value of 'asadmin' is further referring to value of another parameter called 'javaee.home' which is being set in tut-install/javaeetutorial5/examples/bp-project/build.properties
    I have checked the values of both these parameters and they are set correctly, so since it is still giving me problems, at line 145 i hard coded the path instead of the parameter name:
    I replaced line
    <exec executable="${asadmin}" failonerror="${failonerror}" dir="${javaee.home}">
    with
    <exec executable="c:/sun/appserver/bin/asadmin.bat" failonerror="${failonerror}" dir="${javaee.home}">
    This works.

  • Error on server while trying to export a report into PDF using JRC (CR XI)

    13/01/2009        11:52:32            dataengine        ERROR Formula error: recompile formulas failed
    com.crystaldecisions.reports.formulas.FormulaException: Exception in formula '{@Record Selection}' at '{reports_selection.idReport}':
    This field name is not known.
    13/01/2009        11:52:32            JRCCommunicationAdapter        ERROR Failed to export report
    com.crystaldecisions.reports.exportinterface.exceptions.ExportException: Exception in formula '{@Record Selection}' at '{reports_selection.idReport}':
    This field name is not known.
    The error occurs only on the server deployed application, in localhost environment it works fine. So I guess it might have something to do with the server environment, but I can't figure it out. The table reports_selection and the field idReport are well presented in the database.
    The idReport(Number) is passed as a parameter to the report.
    In Select expert... I have the following  formula {table1.idReport} = {?idReport} and in Database expert... I have a join between table1 and reports_selection by idReport.
    Does anyone know what might cause this problem?

    Have you able to preview the report via the Central Management Console?
    When you upload the report template to the server, be sure to do a preview to make is sure its working there.
    It might be that your server is using a different DB Connection.
    Edited by: Rulix Batistil on Jan 14, 2009 10:38 AM

  • Convert smartform output in to PDF using CONVERT_OTF function  how to do it

    Hi Anil , and  Hi All
             I am trying to display smartforms output in java webdynpro
             for that i have got the following code in sdn.
               can anybody please clarify these doubts in the  below code
               1) What are the mandatory input and output parameters
                   I have to pass here in this code to my application
               2) please check my previous post also in this regards please
       . Please reply at the very earliest. Check the below code
    Convert smartform output in to PDF using CONVERT_OTF function module and you can write pdf using parameter 'binfile' of this function in WebDynpro using the following code:
    It is copied from my prg. I hope you understand it.
    public void onActionGetQuote(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionGetQuote(ServerEvent)
    wdThis.wdGetOppt_QwriterCustController().executeZquote_Writer_Input();
    String fileName = wdContext.currentZquote_Writer_InputElement().getOrder().toString().trim() + System.currentTimeMillis() + ".pdf";
    String pdfOutput = new String(wdContext.currentOutputElement().getBinfile());
    if (pdfOutput != null)
    try
    String pdfResoucePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), fileName);
    FileOutputStream fileOutputStream = new FileOutputStream(new File(pdfResoucePath));
    PrintStream ps = new PrintStream(fileOutputStream);
    ps.print(pdfOutput);
    ps.close();
    //Display the PDF to the browser
    String fileURL = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(), fileName);
    IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(fileURL, "Pdf Browser", false);
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.MENU_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.open();
    // To collect all the file created in the server by user
    quoteFiles.add(quoteFiles.size(), pdfResoucePath);
    } catch (Exception e)
    throw new WDRuntimeException(e);
    //@@end

    Hi
        ABAPers prepared a BAPI function module which calls Smart form , how can i execute it from java Webdynpro, so that I can display the smart form in Webdynpro. Pleas reply at the very earliest.  Every answer will be rewarded.
    regards
    jalandhar

  • We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader.

    We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader.
    For which, We created and execute the below command line to call Adobe Reader and print the PDF on a printer.
    "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T "\\<Application Server>\Report\<TEST.PDF>" "<Printer Name>".
    Current Situation: The above command line parameter when executed is working as expected in a User's Workspace.
    When executed in a command line on the Application Server, it is working as expected.
    But, the same is not working while executing it from Deployed environment.
    Software being used: 1. Adobe 11.0 enterprise version. 2. Webshpere Application Server 8.5.5.2.
    Please let us know if there is a way to enable trace logs in Adobe Reader to further diagnose this issue.

    This is the Acrobat.com forum.  Your question will have a much better chance being addressed in the Acrobat SDK forum.

  • We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a

    We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a printer."C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T "\\<Application Server>\Report\<TEST.PDF>" "<Printer Name>". Current Situation: The above command line parameter when executed is working as expected in a User's Workspace. When executed in a command line on the Application Server is working as expected. But, the same is not working while executing it from Deployed environment.Software being used: 1. Adobe 11.0 enterprise version. 2. Webshpere Application Server 8.5.5.2. Please let us know if there is a way to enable trace logs in Adobe Reader to further diagnose this issue.

    This is the Acrobat.com forum.  Your question will have a much better chance being addressed in the Acrobat SDK forum.

  • Problem while Converting TiFF to PDF using OCR

    Hi,
    We have installed Adobe LiveCycle8.2 PDF Generator ES trail version, Acrobat Pro Extended 9.0.
    OS: Windows XP Service Pack3,
    App Server: WebSphere 6.1.0.19
    DB: SQL Server 2005 SP2.
    We are getting following error while converting TIFF images to PDF Using OCR.
    Error message on AdminUI screen:
    "Error Code:1000
    Error Message: ALC-PDG-001-000-Conversion failed because of an exception. Connection to failed service."
    Error messages in server log file:
    [10/10/08 18:16:50:015 IST] 00000043 ProcessResour W com.adobe.service.ProcessResource$ErrorReaderThread run BMC024: Service Native2PDFSvc: Process ProcessResource(name=pdfgen.exe,pid=0) terminated abnormally with error code {3}
    [10/10/08 18:16:50:218 IST] 00000035 ProcessResour A com.adobe.service.ProcessResource startProcess BMC505: Service Native2PDFSvc: Starting native process with command line "C:\\Program Files\\ibm\\WebSphere\\AppServer1\\profiles\\AppSrv01\\installedApps\\HDDLGSDMNK8897Node0 1Cell\\adobe\\server1\\Native2PDFSvc\\bin\\dll\\pdfgen.exe" PDF-NAf6c310002 -beginExecutable "C:\\Program Files\\IBM\\WebSphere\\AppServer1\\java\\jre\\bin\\javaw.exe" -endExecutable -Xmx64m -cp "C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-appmon.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-appmondata.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-bslj.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-csa.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-generatepdf-client.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-pdfg-common-jaxb.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-pdfg-common.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-pdfg-commonbmc.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-pdfg-idl-bmc-websphere.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-pdfg-idl-bmc.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/adobe-utilities.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/avalon-framework-4.1.5.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/comfyj-2.4.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/jacorb.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/jaxb-api.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/jaxb-impl.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/jaxb-libs.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Cell/a dobe/server1/Native2PDFSvc/bin/jniw2.9.5_acrobat1.1.jar;C:/Program Files/ibm/WebSphere/AppServer1/profiles/AppSrv01/installedApps/HDDLGSDMNK8897Node01Ce

    Error message continuation:
    [10/10/08 18:16:50:296 IST] 00000044 SystemOut O Command line '"C:\Program Files\IBM\WebSphere\AppServer1\java\jre\bin\javaw.exe"'
    [10/10/08 18:16:50:437 IST] 00000035 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "doRequiresNew" on bean "BeanId(LiveCycle8#adobe-dscf.jar#EjbTransactionBMTAdapter, null)". Exception data: java.lang.IllegalStateException: Connection to failed service.
    at com.adobe.service.ResourcePooler.allocateResource(ResourcePooler.java:87)
    at com.adobe.service.ConnectionFactoryManagerPeer.getConnectionResourceFromPool(ConnectionFa ctoryManagerPeer.java:79)
    at com.adobe.service.J2EEConnectionFactoryManagerPeerImpl.getConnection(J2EEConnectionFactor yManagerPeerImpl.java:84)
    at com.adobe.service.ConnectionFactoryRmiAdapter.getConnection(ConnectionFactoryRmiAdapter.j ava:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:615)
    at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java:727)
    at java.security.AccessController.doPrivileged(AccessController.java:241)
    at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:725)
    at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1123)
    at $Proxy80.getConnection(Unknown Source)
    at com.adobe.service._ConnectionFactoryRemote_Stub.getConnection(_ConnectionFactoryRemote_St ub.java:58)
    at com.adobe.pdfg.callbacks.NativeToPDFTransactionCallback.convertToPdf(NativeToPDFTransacti onCallback.java:185)
    at com.adobe.pdfg.callbacks.NativeToPDFTransactionCallback.doInTransaction(NativeToPDFTransa ctionCallback.java:163)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionBMTAdapterBean.doRequiresNew (EjbTransactionBMTAdapterBean.java:218)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EJSLocalStatelessEjbTransactionBMTAdapter_ 3af08fdf.doRequiresNew(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:133)
    at com.adobe.idp.dsc.transaction.impl.DefaultTransactionTemplate.execute(DefaultTransactionT emplate.java:79)
    at com.adobe.pdfg.BMCCaller.invokeInSMT(BMCCaller.java:769)
    at com.adobe.pdfg.Native2PdfCaller.callNativeBMC(Native2PdfCaller.java:779)
    at com.adobe.pdfg.Native2PdfCaller.createPDF(Native2PdfCaller.java:298)
    at com.adobe.pdfg.GeneratePDFImpl.createPDFCommon(GeneratePDFImpl.java:342)
    at com.adobe.pdfg.GeneratePDFImpl.createPDF(GeneratePDFImpl.java:172)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:615)
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
    at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:140)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionBMTAdapterBean.doBMT(EjbTran sactionBMTAdapterBean.java:197)
    at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EJSLocalStatelessEjbTransactionBMTAdapter_ 3af08fdf.doBMT(Unknown Source)
    at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:95)
    at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:102)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:91)
    at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:21 5)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
    at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
    at com.adobe.aes.web.create.CreatePDFAct.createPDF(CreatePDFAct.java:383)
    at com.adobe.aes.web.create.CreatePDFAct.createPDF2(CreatePDFAct.java:402)
    at com.adobe.aes.web.create.CreatePDFAct.execute(CreatePDFAct.java:174)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    at com.adobe.aes.web.AesActionServlet.service(AesActionServlet.java:63)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1095)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1036)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
    at com.adobe.idp.um.auth.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:154)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java: 190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:832)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:565)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.jav a:90)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
    at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink .java:458)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink .java:387)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
    at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConn ectionInitialReadCallback.java:214)

  • How to show/print waiting message when system is serving pdf to browser

    Hi,
    does anybody know how to print/show "please wait for your request to be completed..." message when they try to click GeneratePdf button for example
    they way i do serving pdf to the browser is as below
    response.reset();
    response.setContentLength(contentLength);
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition", "inline; filename=\""System.currentTimeMillis()+".pdf"+ "\"");
    output = new BufferedOutputStream(response.getOutputStream());
    while (contentLength-- > 0) {
    output.write(input.read());
    output.flush();and this is what was written in my popup jsp ( when user click GeneratePdf , the application will process it and at the end serve pdf file to the user using popup window )
    <body> <h1>Please Wait for your request to be completed...........</h1> </body> </html>
    <%
    boolean redirect=false;
    try{
    PdfDispatcher.dispatchApplication(response,session);
    }catch(Throwable t){
    System.out.println("Application Dispatcher Exception ... "+t.getMessage());
    System.out.println("Continue as per normal....");
    redirect = true; // will redirect to other jsp output
    if(redirect){
    //go to other jsp
    }The problem is my message above never got printed to the page ( i guess because the browser thinks that the response has not been completed )
    by the time the response has been completed the whole page will be cover in pdf document
    The reason i want to do this because my user complaining that they see blank page for long time when the system is slow to generate/server pdf to them.
    and it would be better to show some "waiting message" when the system is processing the application and server pdf at the end of the operations.
    anybody know how to workaround this?
    Thanks

    just_a_kid83 wrote:
    does anybody know how to print/show "please wait for your request to be completed..." message when they try to click GeneratePdf button for exampleUse JavaScript+DOM. Add a <div> somewhere in the page where the message should be displayed and put the message and an animated 'loading' gif in it. Hide the <div> using the CSS 'display' property which is set to 'none'. Then add an onclick event to the button/link which downloads the PDF file which gets the <div> element by its ID and set its 'display' property to 'block'.

  • To convert multiple image files to pdf using pdfsharp in C#

    Hey guys I have this C# code to convert any image file to .pdf using pdfsharp.dll. But I want to select multiple images for conversion please help. here's my code (plz note enable pdfsharp.dll in the reference)
    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Linq;
    usingSystem.Text;
    usingSystem.Threading.Tasks;
    usingPdfSharp.Pdf;
    usingPdfSharp.Drawing;
    usingSystem.IO;
    namespaceConsoleApplication1
    classProgram
    staticvoidMain(string[]
    args)
    PdfDocumentdoc =
    newPdfDocument();
    doc.Pages.Add(newPdfPage());
    XGraphicsxgr =
    XGraphics.FromPdfPage(doc.Pages[0]);
    XImageimg =
    XImage.FromFile(source
    path...);
    xgr.DrawImage(img,0,0);
    doc.Save(destination path...);
    doc.Close();

    try this one
    public string CreatePDF(System.Collections.Generic.List<byte[]> images)
    dynamic PDFGeneratePath = Server.MapPath("../images/pdfimages/");
    dynamic FileName = "attachmentpdf-" + DateTime.Now.Ticks + ".pdf";
    if (images.Count >= 1) {
    Document document = new Document(PageSize.LETTER);
    try {
    // Create pdfimages directory in images folder.
    if ((!Directory.Exists(PDFGeneratePath))) {
    Directory.CreateDirectory(PDFGeneratePath);
    // we create a writer that listens to the document
    // and directs a PDF-stream to a file
    PdfWriter.GetInstance(document, new FileStream(PDFGeneratePath + FileName, FileMode.Create));
    // opens up the document
    document.Open();
    // Add metadata to the document. This information is visible when viewing the
    // Set images in table
    PdfPTable imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    for (int ImageIndex = 0; ImageIndex <= images.Count - 1; ImageIndex++) {
    if ((images(ImageIndex) != null) && (images(ImageIndex).Length > 0)) {
    iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(SRS.Utility.Utils.ByteArrayToImage(images(ImageIndex)), System.Drawing.Imaging.ImageFormat.Jpeg);
    // Setting image resolution
    if (pic.Height > pic.Width) {
    float percentage = 0f;
    percentage = 400 / pic.Height;
    pic.ScalePercent(percentage * 100);
    } else {
    float percentage = 0f;
    percentage = 240 / pic.Width;
    pic.ScalePercent(percentage * 100);
    pic.Border = iTextSharp.text.Rectangle.BOX;
    pic.BorderColor = iTextSharp.text.BaseColor.BLACK;
    pic.BorderWidth = 3f;
    imageTable.AddCell(pic);
    if (((ImageIndex + 1) % 6 == 0)) {
    document.Add(imageTable);
    document.NewPage();
    imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    if ((ImageIndex == (images.Count - 1))) {
    imageTable.AddCell(string.Empty);
    document.Add(imageTable);
    document.NewPage();
    } catch (Exception ex) {
    throw ex;
    } finally {
    // Close the document object
    // Clean up
    document.Close();
    document = null;
    return PDFGeneratePath + FileName;

  • Issue creating PDF using IE plugin (Web Capture 10.0)

    Hello,
    Hopefully someone can assist with this and /or confirm it is a bug.
    We are using Adobe X 10.1.4 with IE9 32bit.
    Problem:
    User creates a PDF using the "Covert" button located on the toolbar.  The issue is that this PDF is saved with permission only allowing that user and administrators access to the document.  In Windows the file appears with a padlock.
    it doesn't matter what the security settings are on the folder -- somehow Adobe always changes the permission when creating the file using the Convert button.
    If I create the SAME PDF in the same folder using the File -> Print -> Adobe PDF -- I have no issues.  The PDF is created and inherits the permissions of the folder.
    Now if I do the same tests using the Mozilla plug-in I have no issue -- the file is created with the correct permissions.
    This is driving me and my users crazy as we use a terminal server and multiple people need to access these PDF documents that are being locked.
    Thanks for the input!
    [email protected]

    Hi,
    KIndly update your Acrobat to the latest version available and see, if the issue is still present!

  • Vertical Text in PDF using CFDOCUMENT

    I am using font tag in a CSS file to layout a table header
    using vertical text. In HTML, the vertical text looks fine.
    However, when I convert the table to a pdf using
    <cfdocument>, the vertical text is displayed as horizintal
    text and does not follow the css specified font family, color or
    size.
    Here is the line in the CCS I am referencing:
    .header_vertical {FONT-WEIGHT: bold; FONT-SIZE: 8pt;
    FONT-STYLE: normal; writing-mode:tb-rl; FONT-FAMILY: helvetica,
    arial, verdana, sans-serif; TEXT-DECORATION: none; COLOR: #0f437c}
    This is CFMX7 on a Windows Server 2003 OS running IIS.
    Any ideas???
    Thanks.

    Hi there, did you find a solution to this?
    I had the same issue and no matter what i tried it didn't
    work. I found out that CFDOCUMENT doesn't support CSS2.
    Eventually I came up with a clunky solution, but had no other
    choice. I bought some imaging software called Alagad (
    http://www.alagad.com) which
    produces the vertical text as images on the fly. Its not ideal, but
    there was no ther way I could disply the text.
    Hope this helps you.
    Ally

  • Convert list item attachment from docx to pdf using Word Automation Services

    I have been trying to convert List Item attachments from docx to pdf using word automation services, it works in a normal document library but when I use the list attachment it throws a null reference error.
    var settings = new ConversionJobSettings();
    settings.OutputFormat = Microsoft.Office.Word.Server.Conversions.SaveFormat.PDF;
    var conversion = new ConversionJob("Word Automation Services", settings);
    conversion.UserToken = SPContext.Current.Site.UserToken;
    var wordFile = SPContext.Current.Site.RootWeb.Url + "/" + wordForm.Url;
    var pdfFile = wordFile.Replace(".docx", ".pdf");
    conversion.AddFile(wordFile, pdfFile);
    conversion.Start();
    Using reflector I was able to see my problem lies in Microsoft.Office.Word.Server.FolderIterator.cs where it uses SPFile.Item which returns NULL
    internal void CheckSingleItem(SPFile inputFile, SPFile outputFile)
    Microsoft.Office.Word.Server.Log.TraceTag(0x67337931, Microsoft.Office.Word.Server.Log.Category.ObjectModel, Microsoft.Office.Word.Server.Log.Level.Verbose, "OM: FolderIterator start a single item: source='{0}'; dest='{1}'", new object[] { inputFile.Url, outputFile.Url });
    Stopwatch stopwatch = Microsoft.Office.Word.Server.Log.StartPerfStopwatch();
    try
    this.CheckInputFile(inputFile.Item);
    this.CheckOutputFile(outputFile.Url);
    Is there any way to get around this?

    Hi Qfroth,
    According to your description, my understanding is that when you use word automation service to convert Word to PDF for list item attachment, it throws the null reference error.
    I suggest you can create an event receiver and convert the word to memory stream like below:
    private byte[] ConvertWordToPDF(SPFile spFile, SPUserToken usrToken)
    byte[] result = null;
    try
    using (Stream read = spFile.OpenBinaryStream())
    using (MemoryStream write = new MemoryStream())
    // Initialise Word Automation Service
    SyncConverter sc = new SyncConverter(WORD_AUTOMATION_SERVICE);
    sc.UserToken = usrToken;
    sc.Settings.UpdateFields = true;
    sc.Settings.OutputFormat = SaveFormat.PDF;
    // Convert to PDF
    ConversionItemInfo info = sc.Convert(read, write);
    if (info.Succeeded)
    result = write.ToArray();
    catch (Exception ex)
    // Do your error management here.
    return result;
    Here is a detailed code demo for your reference:
    Word to PDF Conversion using Word Automation Service
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Cannot generate chart in PDF using BI Publisher

    I have a java program to generate chart in PDF using BI publisher. In some platforms the chart cannot be generated. Get the following exception.
    [061812_075947838][][ERROR] java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.invokeMethod(Unknown Source)
    at oracle.apps.xdo.template.rtf.img.RTFChartUtil.generateChartAsBase64(Unknown Source)
    at oracle.apps.xdo.template.rtf.XSLTFunctions.chart_svg(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.xdo.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:111)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:307)
    at oracle.xdo.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:226)
    at oracle.xdo.parser.v2.XSLValueOf.processAction(XSLValueOf.java:101)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLResultElement.processAction(XSLResultElement.java:180)
    at oracle.xdo.parser.v2.XSLNode.processChildren(XSLNode.java:417)
    at oracle.xdo.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:512)
    at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
    at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
    at com.edocs.common.reporting.batch.BatchEventHandler.generatePDFFile(BatchEventHandler.java:327)
    at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:252)
    at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:136)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:126)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:46)
    at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
    at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NoSuchMethodError: oracle.dss.util.CustomStyle.<init>(Ljava/io/InputStream;)V
    at oracle.dss.graph.CommonGraph.setStyleStream(CommonGraph.java:10774)
    at oracle.dss.graph.CommonGraph.setStylePath(CommonGraph.java:10743)
    at oracle.dss.graph.CommonGraph.setStylePathXML(CommonGraph.java:12138)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:13348)
    at oracle.dss.graph.CommonGraph._setXML(CommonGraph.java:15821)
    at oracle.dss.graph.CommonGraph.setXML(CommonGraph.java:14751)
    at oracle.dss.graph.Graph.setXML(Graph.java:5243)
    ... 60 more
    In office word bi publisher plugin, load the xml, the chart can be generated.
    The above exception only occurs in some linux and solaris platforms, but never occurs in windows.
    The following plateform throws exception.
    Oracle Linux Server release 5.6 + java version "1.6.0_25"
    The following plateform doesn't throw exception.
    Enterprise Linux Enterprise Linux Server release 5.4 (Carthage) + java version "1.6.0_05"
    The strange thing is in those platforms which can throw exception, if the code is not running in EJB, the chart still can be generated.
    In other words, if the normal web or standalone app invokes that program; the chart can be generated.
    The java code is as below.
         public static void generate(String inputXML, String pdfTempPath, String outputPDF) {
              Reader reader = null;
              try {
                   File xmlFile = new File(inputXML);
         reader = new BufferedReader(new InputStreamReader(new FileInputStream(xmlFile), "UTF-8"));               
              ByteArrayOutputStream tmpXSL = new ByteArrayOutputStream();           
              RTFProcessor rtfProcessor = new RTFProcessor(pdfTempPath);
                   rtfProcessor.setOutput(tmpXSL);
                   rtfProcessor.process();           
              ByteArrayInputStream in = new ByteArrayInputStream(tmpXSL.toByteArray());
              FOProcessor processor = new FOProcessor();
              processor.setData(reader);
              processor.setTemplate(in);
              processor.setOutput(outputPDF);
              processor.setOutputFormat(FOProcessor.FORMAT_PDF);           
              processor.generate();
              catch(Exception e) {
                   e.printStackTrace();
              finally {
                   try {
                        if(reader!=null) {
                             reader.close();
                   } catch (Exception e) {
    Can anyone explain why this exception is thrown?
    Thanks a lot.

    Hello Tux Dueñas,
    I think you need to have ACL's setup in Oracle 11g in order to be able to connect to the BI Publisher server. Check the following link on how to setup ACL's in 11g...
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/afterup.htm#BABFCBJI
    Thanks,
    Machaan
    Edited by: Machaan on Jan 25, 2011 11:49 AM

Maybe you are looking for