Input stream to pdf file generation in WDJ

Hi Experts,
I want to create a pdf file from some inputstream or string content in Webdynpro Java code.
Can anyone please provide me some code snippet related to this.
I tried below code:
public class test {
     public static void main(String[] args) {
               String strFilePath = "C://demo.pdf";
               try {
                         FileOutputStream fos = new FileOutputStream(strFilePath);
                         String strContent =
                                   "Write File using Java FileOutputStream example !";
                         fos.write(strContent.getBytes());
                         fos.close();
               } catch (FileNotFoundException ex) {
                         System.out.println("FileNotFoundException : " + ex);
               } catch (IOException ioe) {
                         System.out.println("IOException : " + ioe);
It is creating a pdf file in my local system but while opening the file it is saying "Corrupted file".-
Any kind of help will be highly appreciated.
Regards,
Sambarn

You have to use WDResource and related classes for reading/writing the files on portal app server.
For getting some Idea, look at this wiki.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71?quicklink=index&overridelayout=true
-Yugandhar Reddy

Similar Messages

  • Stream a pdf file But want it to open in the browser automatically.

    Hi all,
    I have successfully stream a pdf file to the browser. But it ask the user to save the pdf. This is not what i intended to do. I would like the browser to automatically load the pdf file.
    How could i do that?
    I already added the setContentType to "application/pdf".
    Following is portion of my code:
    JasperReport jasperReport = (JasperReport)JRLoader.loadObject(preprintedForm);
              JasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, paramMap ,new JREmptyDataSource());
              response.setContentType("application/pdf");
              response.setHeader("Content-Disposition","attachment; filename=test.pdf");
              JRPdfExporter exporter = new JRPdfExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
              OutputStream ouputStream = response.getOutputStream();
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
              try
                                     exporter.exportReport();
                                catch (JRException e)
                                     throw new ServletException(e);
                                finally
                                     if (ouputStream != null)
                                          try
                                               ouputStream.close();
                                          catch (IOException ex)
                                }Thanks in advance.

    Hi,
    Try this
    response.setHeader("Content-Disposition","inline; filename=test.pdf");
    and from the Jsp or HTML from where you are trying to access this use. window.location.href.
    Thanks and Regards,
    Harsha

  • Parse XML input stream (no .xml file)?

    i have a java applet calling a web service that returns XML data as an input stream (char by char from SOAP) to this applet. if i append a all the chars to a string, is there some XML tool that will parse the string as if it were an XML document (like a getElement functions)?
    the applet cannot write the data to a .xml file, and i don't want to mess around with .jarsigning. any ideas?
    thanks,
    jonathan

    The XML parsers you are likely to be using support receiving input from a variety of sources besides files. For example you could parse XML from a String variable by passing a StringReader wrapping that String to the parser. Check the documentation for more details.

  • Individual pdf file generation

    Hi all,
    I want to genrate pdf file after execution of my report in such a way that I give it a parameter name cust_id = 9092 and occurance in second text box is 5...it means loop started from 9092 and create 9092,9093,9094,9095,9096 files in specific folder and stop.it is not necessary that cust_id is in sequence.
    Following in my code:
    DECLARE
         v_SAM_CUST_ID       NUMBER(22);
           --v_ACCT_CUST_ID     NUMBER(22);
         v_rid               NUMBER;
         --v_p_cust_id         NUMBER(22);
         v_start_from        number(10):= :START_FROM;
         v_to_next           number(10):= :to_next;
         v_trid          number;
    CURSOR C1 IS  SELECT A.RID,SAM_CUST_ID      FROM (SELECT ROWNUM RID,SAM_CUST_ID
                                  FROM SAM ,DE_ADDR
                                  WHERE SAM.SAM_CUST_ID=DE_ADDR.DE_CUST_ID
                                  AND SAM.SAM_CUST_ID >= 1
                                  AND SAM.SAM_FREQUENCY IN ('DAILY','MONTHLY','Quarterly','Half yearly','Yearly')) A
                                  WHERE A.RID <= 10;
    BEGIN
         v_start_from      := :START_FROM;
         v_to_next     := :to_next;
         v_rid:=0;
         v_p_cust_id:=0;
         if :TEXT_BOX1='S' then
         message('Firing IF..');
           OPEN C1;
           LOOP
                FETCH C1 INTO v_trid,v_SAM_CUST_ID;
                EXIT WHEN C1%NOTFOUND;
                message('generating rport...');
                host('rwclient server=reptest report=c:\cust_print1.rdf p_1='||v_SAM_CUST_ID||' userid=wh1/wh1@dwh desformat=pdf destype=file desname=c:/temp/'||v_SAM_CUST_ID||'.pdf');
              END LOOP;
           CLOSE C1;     
              END LOOP;
      ELSE
    message('ELSE.....');
      END IF;
      END; 
      Any help would be appriciated.

    You are almost there ...
    Assuming that SAM.SAM_CUST_ID holds the customer ids (9092...)
    - change the cursor
    - to accept the input parameter of "p_cust_id"
    - modify the where clause selecting als customer_id >= p_cust_id
    - implement an order by clause ORDER BY SAM.CUST_ID
    - change the OPEN C1 statement to OPEN C1(p_cust_id);
    - declare a counter variable v_records_fetched NUMBER := 0;
    - EXIT WHEN C1%NOTFOUND OR v_records_fetched >= 5;
    - after the EXIT WHEN statement insert row :
    v_records_fetched := v_records_fetched +1;
    Your code should look like this
    DECLARE
         v_SAM_CUST_ID       NUMBER(22);
           --v_ACCT_CUST_ID     NUMBER(22);
         v_rid               NUMBER;
         v_p_cust_id         NUMBER(22);
         v_start_from        number(10):= :START_FROM;
         v_to_next           number(10):= :to_next;
         v_trid          number;
                    v_records_fetched NUMBER := 0;
    CURSOR C1(p_cust_id    NUMBER)
    IS  SELECT A.RID,SAM_CUST_ID      FROM (SELECT ROWNUM RID,SAM_CUST_ID
                                  FROM SAM ,DE_ADDR
                                  WHERE SAM.SAM_CUST_ID=DE_ADDR.DE_CUST_ID
                                  AND SAM.SAM_CUST_ID >= p_cust_id
                                  AND SAM.SAM_FREQUENCY IN ('DAILY','MONTHLY','Quarterly','Half yearly','Yearly')) A
                                  WHERE A.RID <= 10 ORDER BY SAM.CUST_ID;
    BEGIN
         v_start_from      := :START_FROM;
         v_to_next     := :to_next;
         v_rid:=0;
         v_p_cust_id:=9092;
                   v_records_fetched := 0;
         if :TEXT_BOX1='S' then
         message('Firing IF..');
           OPEN C1(v_p_cust_id);
           LOOP
                FETCH C1 INTO v_trid,v_SAM_CUST_ID;
                EXIT WHEN C1%NOTFOUND OR v_records_fetched >=5;
                                    v_records_fetched := v_records_fetched +1;
                message('generating rport...');
                host('rwclient server=reptest report=c:\cust_print1.rdf p_1='||v_SAM_CUST_ID||' userid=wh1/wh1@dwh desformat=pdf destype=file desname=c:/temp/'||v_SAM_CUST_ID||'.pdf');
              END LOOP;
           CLOSE C1;     
              END LOOP;
      ELSE
    message('ELSE.....');
      END IF;
      END; 
      Message was edited by:
    user434854

  • FOP Serializer, PDF File generation

    In attempting to generate PDF files from XSQL: Any ideas which jar files from the Apache FOP-0.20.5 release need to be included in the classpath of the XSQL servlet (XDK 9.2.0.2.0) to make the emptablefo.xsl demo function? Are there other jar files required (other than xsqlserializers.jar)? The docs seem to want w3c.jar, which doesn't come with that release. Where does one find it, if needed?
    I keep turning up with
    XSQL-017: Unexpected Error Occurred
    java.lang.NoSuchMethodError
    at oracle.xml.xsql.serializers.XSQLFOPSerializer.serialize(XSQLFOPSerializer.java:19)
    Is my Adobe plugin meant to fire up if this works correctly?
    Cheers

    Hi All,
    I got the latest FOR version and have all the orther jars in my class path. I am using XSQL and with the previous version of FOP, my PDF display was fine.
    With the new version of FOP i am having the problems mentined on this forum.
    As 12... suggested, i got the XSQLFORSerializer , compiled and added it in the jar(xsqlserializers.jar) and added the jar in my class path, added the other mentioned jar(except xercesImpl-2.2.1.jar since xerces1-2.3.jar is in the class path and adding xercesImpl-2.2.1.jar causes JRun not to start with some kind of weird Null TLD string "--" cannot be in the comments error).
    Everything looks fine ,just that the pdf does not show and the message is
    07/01 10:47:23 user CacheFilesServlet: Processing XSQLRequest...
    [INFO] java.lang.NullPointerExceptionbuilding formatting object tree
    at org.apache.fop.pdf.PDFDocument.outputHeader(PDFDocument.java:1321)
    at org.apache.fop.render.pdf.PDFRenderer.startRenderer(PDFRenderer.java:
    237)
    at org.apache.fop.apps.StreamRenderer.startRenderer(StreamRenderer.java:
    188)
    at org.apache.fop.fo.FOTreeBuilder.startDocument(FOTreeBuilder.java:240)
    at org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:454)
    at org.apache.fop.apps.Driver.render(Driver.java:498)
    at org.apache.fop.apps.Driver.render(Driver.java:518)
    at oracle.xml.xsql.serializers.XSQLFOPSerializer.serialize(XSQLFOPSerial
    izer.java:38)
    at oracle.xml.xsql.XSQLPageProcessor.process(XSQLPageProcessor.java:257)
    at oracle.xml.xsql.XSQLRequest.process(XSQLRequest.java:304)
    at oracle.xml.xsql.XSQLRequest.process(XSQLRequest.java:198)
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1045)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:102)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    241)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)07/01 10:48:04 user CacheFilesServlet: output length = 0
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    com.cleverdevices.util.ReportGenerationException: No output from XSQL
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1065)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:102)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    241)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)07/01 10:48:04 user CacheFilesServlet: Deleting bad cache file: C:\JR
    un4\servers\default\tatools\main\reports\cache\whc_kneel_bu
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrsdepot_dd_1,,_20040630.pdf
    ics.invokeRunnable(ThreadPool.java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    com.cleverdevices.util.ReportGenerationException: IO Error: com.cleverdevices.ut
    il.ReportGenerationException: No output from XSQL
    at com.cleverdevices.util.CacheFilesServlet.generateReport(CacheFilesSer
    vlet.java:1076)
    at com.cleverdevices.util.CacheFilesServlet.doGet(CacheFilesServlet.java
    :372)
    Any pointers will help.
    I am using XSQL and JRun server.
    Thanks

  • PDF File Generation in SAP-ByD

    Dear All,
    How to generate PDF file based  reports in SAP-ByD
    Best Regards,
    Harish.Y

    Hi Harish,
    What do you mean by PDF file based reports?
    In ByD, typically you can generate PDF for various use-cases like preview (read only PDF), Send To (Read / write PDF) e.g. Sales order as PDF, etc. There is  a concept of Form Template maintenance, where you can view/edit the existing template and even create your own variant.
    Please describe your requirement if this doesnot answer your question fully.
    Regards,
    Damandeep
    Edited by: Damandeep Thakur on Mar 6, 2012 7:05 AM

  • PDF file generation

    I am unable to generate a pdf file of a report that I generated. I get Rep-03335 error. I can use all the help I can get

    Be sure you have a default printer
    assigned. Check the permissions on
    the machine as well. Try installing a
    later version of acrobat too.

  • How to input data into Pdf file

    I am not too sure if I am posting my question in the right forum.
    I would like to know what version of Adobe acrobat can allow me to create a document, where clients can input data into it?
    Here is an online example
    http://www.uscis.gov/files/form/N-400.pdf
    Thanks.
    Oceans

    If your users will be using Reader and you want your users to be able to save the form or email it, you will need to apply 'Extended Form Rights' (version 8 Provessional or Version 9 Standard or better) and for signatures you will need to apply 'Signature Rights' using an Adobe server product.

  • I'm hoping someone can kindly help with me with an error message that is causing PDF file generation failure when using InDesign CS6 for Windows and Acrobat Distiller 8.0

    <PDFX ISO="15930-1:2001" COMPLIANT="true">
    PDF/X Compliance Report
    1.  Summary
       Warnings: The total found in this document was 0.
       Violations: The total found in this document was 0.
       No problems were found in the document.
       This document passes PDF/X-1a:2001 compliance checks.
    </PDFX>

    @Jack – this is no error message, just a log, that all was running ok.
    See detailed answer here:
    Re: I am getting some errors while distilling the post script file.
    Uwe

  • Saving an input stream as a file.

    Hi,
    Please can any one tell me how can i directly save an InputStream as a file. If it is not possible then plz tell me how can i make reading the InputStream and writing to the File using the FileOutputStream faster. Actually i am using the code below:-
    DataInputStream dataInputStream = new DataInputStream (urlConnection.getInputStream ());
    FileOutputStream downloadFileStream=new FileOutputStream("Myfile.txt");
    int data;
    while((data=dataInputStream.read())!=-1)
    downloadFileStream.write(data);
    This is reading the dataInputStream byte by byte and writing to the FileOutputStream byte by byte which is a very slow affair. My dataInputStream can be at max of 15MB. Plz help. And thanks for any of ur suggestions.

    Dude. You cannot increase your Internet connection's
    bandwidth by using clever Java. Sorry to break the
    news.True, but copying a stream byte-for-byte can indeed be slower (even on a fairly limited connection).
    Using a BufferedReader/BufferedWriter and/or reading into a byte-array instead is usually a fairly simple and effective way of speeding things up.

  • AIX-based printing and PDF file generation

    Greetings,
    looking to find a best practices approach to scheduled printing of pdf BOXI reports hosted by in an AIX environment to a Windows AD secured network printer. 
    Looking at three possible approaches:
    1. AIX-based printing: lpr queue with some ghostscript translation to postscript
    2. Windows-based printing via SAMBA: AIX based printing using samba services
    3. Windows-based printing via  FTP: transfer the file out from the AIX server and script the printing using Control-M
    Leaning towards #3 presently.  Expert guidance would be greatly appreciated.
    Martin

    Hi Martin,
    I faced a similar situation at a client site and after actually trying out Option 1, then considering the cost of Option 2 (resources, skill sets and long-term maintenance), we decided to go for Option 3.
    With Option 1, we used the lpr queue commands to send the reports to particular printers (print queues) on the that were registered on the AIX box. We faced two major problems with this approach.
    (1) We had what we called the 'default' printer problem, where, may be based on the volume of pages we were printing or the performance issues on the server itself, print jobs would go the default print queue on the AIX server. As you can imagine, that was not good. Jobs that were intended for one department were ending up in another, and the default location had to start parsing through the print outs and create piles. Operational nightware.
    (2) Cover sheets... We had 1 report (basically a form) that needed to be printed with data for different departments (six depts). So a developer wrote a little java app that called BusinessObjects and passed in the report parameters - and ID, and the printer name. The problem that we faced was that the print jobs would come out the other end, each with its own cover sheet. Even though we passed in the AIX command to suppress the  cover sheet, they came out. I don't remember whether specifying the switch in the CMC worked or not - but we didn't have that luxury - we had to do programmatically because the printing was so dynamic.
    So we opted for a rather simple situation, which was made possible also because the customer's license allowed it. We installed the report job servers (no CMS) on a windows servers, assigned them to the CMS pool on the AIX server, installed the printers we needed on the Win server. Then we created a Server group that included just the Windows servers (report processing servers), and locked the report in question to only be processed by servers in that group. So the report would only be processed by the Windows servers with the necessary printers.
    The solution has been in operation for over 12 months and working great. We can manage all the servers from the CMC and with auditing turned on, we have great visibly on the performance of the system. Because this printing system is so critical, the process is being enhanced by throwing the stats on an Xcelsius dashboard for real-time monitoring by the operations folks.
    Hope this helps. I'll be glad to share more if you're interested.
    Will

  • PDF File Generation in LabWindows/CVI

    Hi,
    I'm looking for ideas on how to automatically generate multiple-page PDF documents in LabWindows/CVI.
    The pages consist of images of panels that have automatically updated some graphs.
    Any ideas?
    Thanks,
    Kirk

    Howdy Kirk,
    Great question. You might try one of these four options:
    Install a "PDF Printer" in Windows. This is essentially a virtual Windows printer that we can print to in CVI using functions like PrintPanel, PrintTextFile, etc.
    Find a commandline PDF creator and call the commandline application from CVI. (See the launchexe.cws example located in the Example Finder under Comm w/External Apps » OS)
    Find a DLL you can call to create a PDF. (See the examples located in the Example Finder under Comm w/External Apps » Using External Code)
    Install a PDF creator and communicate with it through ActiveX if it has an ActiveX server.
    Sorry I can't provide a specific recommendation for PDF software for these suggestions, but I hope it gets you going in the right direction!
    Message Edited by pBerg on 02-05-2010 10:00 AM
    Warm regards,
    pBerg

  • Problem on opening pdf file in IE inline (through streaming method)

    Hello
              I had a problem opening pdf file at IE through streaming. I create a page
              that have a hyperlink to open the new window and talk to a serlvet. When
              clicked, this serlvet will stream a pdf file from the file server to serlvet
              output stream. And the pdf file will be displayed within the browser.
              The problem comes that I can see the Acrobat Reader trailer screen display
              but the brower show nothing. I click refresh button to that serlvet to
              reload then it come up the content.
              Is anyone have the same trouble on this and any solution will be
              appreciated.
              Rondy Lee
              State Street Australia Ltd.
              

    Hello Rondy,
              You vae set mime type to application/pdf, which is good. But IE doesn't care
              of it !
              And I think your URL is too long because and I'm sure it leads to a buffer
              overflow (as they say at MS in their bug report).
              So as a workaround, you can rename your servlet mapping from Ecd/Download to
              Ecd/Download.pdf if you can, or make the URL length much more smaller.
              Try to go to MS site to find what is the precise bug#. I can't remember what
              it its number.
              I hope you'll find a solution.
              Dom
              "Rondy Lee" <[email protected]> a écrit dans le message news:
              [email protected]...
              > Thanks Dom, I will try to find it out
              >
              > This is the sample URL I used on local host:
              >
              http://ausyd1-wdev-01:7001/Datalightning/Ecd/Download?EcdId=20&Type=I&OpenMo
              > de=O&OutputType=PDF
              >
              > Also, I set content-deposition to "inline" to enforce IE to open the pdf
              > file. Content Type is application/pdf
              >
              > I hope this can tell more information.
              >
              > Rondy.
              >
              > State Street Australia Ltd.
              >
              > "Dominique Jean-Prost" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hello Rondy.
              > >
              > > I already had problems using servlet streaming a pdf file to IE.
              > > What is the exact URL of your servlet ? IE has a bug : it does not care
              of
              > > the mime content you set up (I guess you made it). It only cares of the
              > > extension of the file it ties to read. In your case, I guess there is no
              > > extension because you're using a servlet. To look for the extension, it
              > > search the last dot in the URL, and it may have a problem it the URL is
              > too
              > > long (buffer overflow...).
              > > So you can map your servlet to an url which has a dot in its name, and
              > make
              > > the URL length smaller.
              > > I can't remember the IE bug #id but, it is official at MS.
              > > I hope this will help you.
              > >
              > > dom
              > >
              > > "Rondy Lee" <[email protected]> a écrit dans le message news:
              > > [email protected]...
              > > > Hello
              > > >
              > > > I had a problem opening pdf file at IE through streaming. I create a
              > page
              > > > that have a hyperlink to open the new window and talk to a serlvet.
              When
              > > > clicked, this serlvet will stream a pdf file from the file server to
              > > serlvet
              > > > output stream. And the pdf file will be displayed within the browser.
              > > >
              > > > The problem comes that I can see the Acrobat Reader trailer screen
              > display
              > > > but the brower show nothing. I click refresh button to that serlvet to
              > > > reload then it come up the content.
              > > >
              > > > Is anyone have the same trouble on this and any solution will be
              > > > appreciated.
              > > >
              > > > Rondy Lee
              > > >
              > > > State Street Australia Ltd.
              > > >
              > > >
              > > >
              > > >
              > > >
              > >
              > >
              >
              >
              

  • Providing security to the PDF file using apache FOP in java

    I am working on PDF file generation using Apache FOP, I have security concerns which are
    1. PDF file will be placed in a folder after generation and that should not be copied to other locations.
    2. PDF file should only have an option print nothing else. The save/save as options should never be enabled.
    3. PDF expiry date is required, so that PDF file will get expire after duration.

    HI,
    I did that too, with too much experiments.
    Code snippet for reference.
    PdfReader reader = new PdfReader(getOutputFilePath());
    PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf"));
    stamper.setDuration(1,1);
    int permissions = PdfWriter.HideMenubar & PdfWriter.HideToolbar & PdfWriter.HideWindowUI & ~( PdfWriter.AllowCopy | PdfWriter.AllowModifyAnnotations | PdfWriter.AllowFillIn | PdfWriter.AllowAssembly | PdfWriter.AllowModifyContents | PdfWriter.AllowScreenReaders);
    stamper.setEncryption(null, null,
    permissions, PdfWriter.STRENGTH40BITS);
    stamper.setFormFlattening(true);
    System.out.println(stamper.getMoreInfo());
    stamper.close();
    I am able to disable the save button, but I am unable to disable the save as option.
    It would be great help, if you can give some inputs on this.

  • How to batch upload PDF files into database BLOB

    Hello.
    I have a requirement to batch upload PDF files into BLOB column of an Oracle 8.1.7 table from Forms 6i Web. The content of the blob column (ie. the PDF content) MUST be displayable from all client software (eg. Oracle Web forms, HTML forms, etc.)
    Our environment is
    Middle-tier is 9iAS on Windows/2000
    Database is Oracle 8.1.7.0.0 on VMS
    Oracle Web Forms 6i Patch 10
    Basically my Oracle web form program will display a list of PDF files to upload and then the user can click on the &lt;Upload&gt; button to do the batch upload. I have experimented the following approaches but with no luck.
    1. READ_IMAGE_FILE forms built-in = does NOT work because it cannot read PDF file. I got error FRM-47100: Cannot read image file
    2. OCX and OLE form item = cannot use this because it does NOT work on the Web. I got error FRM-41344 OLE object not defined
    3. I cannot use DBMS_LOB to do the load because the PDF files are not in the database machine.
    4. Metalink Note 1682771.1 (How to upload binary documents back to database blob column from forms). When I used this, I got ORA-6502 during the hextoraw conversion. In using this solution, I have downloaded a bin2hex.exe from the Google site. I've noticed that when I looked at the converted HEX file, each line has the character : (colon) at the beginning of each line. I know the PDF file has been converted correctly to HEX format because when I convert the HEX file back to BIN format using hex2bin.exe, I'm able to display the converted bin file in Acrobat Reader. When I removed the : (colon) in the HEX file, I did NOT get the ORA-6502 error but I CANNOT display the file in Acrobat Reader. It gives an error "corrupted file".
    5. upload facility in PL/SQL Web toolkit - I tried to automatically submit the html form (with htp.p) but it does NOT load the contents of the file. I called the URL from Oracle forms using web.show_document. There seems to be issues with Oracle Web forms (JInitiator) and HTML (+ htp.p).
    The other options I can think of at this point are:
    1. Use SQL*Loader to do the batch upload via SQL*Net connection and use HOST() built-in from Oracle Webforms to execute SQL*Loader from the 9iAS.
    2. Write a Visual Basic program that reads a binary file and output the contents of the file into a byte array. Then build a DLL that can be called from Oracle webforms 6i via ORA_FFI. I don't prefer this because it means the solution will only work for Windows.
    3. Write a JSP program that streams the PDF file and insert the contents of the PDF file into blob column via JDBC. Call JSP from forms using web.show_document. With this I have to do another connection to the database when I load the file.
    4. Maybe I can use dbms_lob by using network file system (NFS) between the application server and VMS. But this will be network resource hungry as far as I know because the network connection has to be kept open.
    Please advise. Thank you.
    Regards,
    Armando

    I have downloaded a bin2hex.exe from the Google site.
    ... each line has the character : (colon) at the
    beginning of each line. I'm afraid it isn't a correct utility. I hope you'll find the source code of a correct one at metalink forum:
    Doc ID: 368771.996
    Type: Forum
    Subject: Uploading Binary Files: bin2hex and hex2bin do not reproduce the same file
    There is some links to metalink notes and some example about working with BLOB at http://www.tigralen.spb.ru/oracle/blob/index.htm. Maybe it helps. Sorry for my English. If there is any problem with code provided there, let me know by e-mail.

Maybe you are looking for

  • How do i use Desktop PC (Mini Hdmi or DVI) to imac27 as monitor

    How do i use Desktop Pc through imac27 as monitor? first of all i dont want to use bootcamp. cos it dont run high end game, this is a reason i want to use my pc . my Graphics Card use Dvi or mini Hdmi, so which kind of Adapter to use and want full Re

  • UNCAUGHT_EXCEPTION while creating Purchase Order in Extended classic SRM 7

    Hi Experts, I am getting the following message while creating Manual or SC/PO in Extended classic Scenario (SRM7.0 with ECC 6.0) Pl suggest what could be the problems. Error application is coming up. 20091130 E2001 172331 wicomp03 http://wicomp03.wip

  • Error in dynamic Routing in OSB

    I am doing dynamic routing in the proxy service by setting the URL in the Routing Options component in OSB. It's throwing Null Pointer Exception when I am using a URL like this: http://hqcsas095:8080/ShowImage/servlet/DisplayImage?dlNumber=1114 The d

  • Activation on second hand copy of Adobe Creative Suite 5 Design premium student

    My son attends Middle Tennessee State Univerversity. I was considering buy this second hand(used) for him. Will he be able to used this? Thanks for your help. Mike

  • Won't restore Ipod

    My computer says "iTunes could not contact iPod software update server because you are not connected to the internet" when I clearly am. How can I restore my iPod?