Pdf - SOS

Hello, I'm new using adobe and i'm wondering if it's possible to sign a document as a pdf, to later be sent as an email attachment.
Thanks a lot......

Just look at the signature tool and refer to signatures in the manual.

Similar Messages

  • SOS! I suddenly can't read pdf files.

    I got a new Mac Book Air in September and it has been great. Today I suddenly started having trouble viewing PDF files on a government website. I was prompted to update my Adobe and did so. Now, every time I attempt to open any online pdf file I get a black window. I deleted the plug-in and still have the same issue. What can I do to allow myself access to these online pdf files.
    SOS! I have a major research paper due soon and can no longer see the files I was using for my research.

    Back up all data.
    If Adobe Reader or Acrobat is installed, there should be a setting in its preferences such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected. Otherwise do as follows.
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard by pressing the key combination command-C:
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present. The same goes for a plugin called "iGetter," and perhaps others.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Urgent, SOS for help: How to show the pdf file name at the right bottow of the page?

    I want to show the pdf file name at the right bottow of the page for filing purpose, anybody knows anything?
    I know it can be showed at the left bottom through adobe printer, but i need it to be at the right bottom.
    thanks.

    The result is a UIWebView that displays a blank page. No errors occur in the UIWebView delegate method. The thing is that data has the correct length, in bytes, for the PDF I am trying to display, and I also get the pdf file in Library/Application Support/iPhone Simulator/4.3.2/Applications/ Does anyone have an idea as to what might be going wrong here or how I can better debug this problem?

  • SOS! Comment modifier le contenu d'un document PDF natif ou numérisé?

    Bonjour,
    Je ne connais rien à ADOBE!
    Il y a quelques jour, j'ai acheté un PACK ADOBE à 77€....
    Je pensais avec PACK pouvoir modifier le contenu de documents PDF natifs ou numérisés.
    Comment faire?
    Merci de votre attention

    Adobe PDF Pack can convert PDF files to Word, Excel, etc. and vice versa.  It can also perform character recognition (OCR) during export from a scanned document.
    However, it cannot otherwise modify PDF files; you will need Acrobat for that.
    [topic moved to Acrobat.com Services forum]

  • SOS please -- How do I Print a page, Save as PDF, and retain the live links? Mac 10.6.7 / FF 4.0.1 / never had problem b4, now have looked everywhere, what's changed? thanks thanks

    got it all into the question - i think!

    Found it.
    The restore password is not the same as the passcode to access the iPad. (After putting 6-digit codes in all day, I think I'd been conditioned to continue using those codes.) I found the backup password in the Keychain.

  • When sending email PO in a PDF attachment, the attachment can not be openen

    Hi all,
    We are trying to send an email with the PO in PDF format.  We got the email but the attachment can not be opened. 
    Error reads: Adobe could not open test.pdf because  it is either  not a supported file type  or because  the file has been damaged (for example , it was send as a email attachemnet and was not  correctly decoded).
    Could any body bring some light?   We know that everything in SCOT is fine because we can email the PO through configuration to the vendor without problem. It is just these extra copies that do not work.
    a) We are modifying our custom Print program to add the code below after closing the form.
    in few words:
    a) We are getting the OTF from closing the form.
    b) Converting the OTF to PDF
    c) Sending the PDF as attachment.
    data: lt_docs      TYPE TABLE OF docs.
    data: pdf_bytecount TYPE i.
    data: begin of pdfout occurs 0,
       tline type tline,
    end of pdfout.
    Ende Formulardruck --------------------------------------------------*
      CALL FUNCTION 'CLOSE_FORM'
           IMPORTING
                result = result
           tables
                otfdata = otf.
      IF RESULT-TDSPOOLID NE SPACE.
        SPOOLID = RESULT-TDSPOOLID.
        PERFORM PROTOCOL_UPDATE USING '320' SPOOLID SPACE SPACE SPACE.
      ENDIF.
      if result-userexit eq 'C' or
          result-userexit eq 'E'.
        retco = '9'.
      endif.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize           = pdf_bytecount
        TABLES
          otf                    = otf
          doctab_archive         = lt_docs
          lines                  = pdfout
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
    Creation of the document to be sent File Name
       maildata-obj_name = 'TEST'.
    Mail Subject
       maildata-obj_descr = 'Subject'.
    Mail Contents
       append mailtxt.
      describe table mailtxt lines tab_lines.
      read table mailtxt index tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
    Creation of the entry for the compressed document
      clear mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      append mailpack.
    Move OTF code to structure SOLI form email
    CLEAR solisti1. REFRESH solisti1.
    LOOP AT otf.
      solisti1-line = otf.
      APPEND solisti1.
    ENDLOOP.
    Move pdf code to structure soli form email
      clear solisti1. refresh solisti1.
      loop at pdfout.
        solisti1-line = pdfout.
        append solisti1.
      endloop.
      loop at solisti1.
         move-corresponding solisti1 to mailbin.
         append mailbin.
      endloop.
      describe table mailbin lines tab_lines.
    mailhead = 'TEST.OTF'.
      mailhead = 'TEST.PDF'.
      append mailhead.
    Creation of the entry for the compressed attachment
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
    mailpack-doc_type = 'OTF'.
      mailpack-doc_type = 'PDF'.
      mailpack-obj_name = 'TEST'.
      mailpack-obj_descr = 'Subject'.
      mailpack-doc_size = tab_lines * 255.
      append mailpack.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type = 'U'.
      append mailrec.
      mailrec-receiver = '[email protected]'.
      mailrec-rec_type = 'U'.
      append mailrec.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
              EXPORTING
                   DOCUMENT_DATA              = maildata
              TABLES
                   PACKING_LIST               = mailpack
                   OBJECT_HEADER              = mailhead
                   CONTENTS_TXT               = mailtxt
                   RECEIVERS                  = mailrec
              EXCEPTIONS
                   TOO_MANY_RECEIVERS         = 1
                   DOCUMENT_NOT_SENT          = 2
                   DOCUMENT_TYPE_NOT_EXIST    = 3
                   OPERATION_NO_AUTHORIZATION = 4
                   PARAMETER_ERROR            = 5
                   X_ERROR                    = 6
                   ENQUEUE_ERROR              = 7
                   OTHERS                     = 8.
    ENDFORM.

    Dear Monica,
      You need to configure the system with respect to functional point of view and need to write the following code in print program. i have done this and solution is as follows.
    <b>  Reward me for this solution.</b>
    Process 11 (MM)     Sending RFQs and POs to vendors directly from the system instead of sending thru Courier or Fax     
    Existing Process (AS-IS)     Presently system is not supporting this requirement
    Business Requirements     RFQ’s to be linked with vendor master with e-mail to send enquiries directly through system instead of courier/fax. Vice versa P.O’s.  Specifications, drawings should also go to vendor along with mail.
    To-Be     
    Configuration Settings:                  
    1) Spro – Materials management – Purchasing – Messages – Output control – Message types – Define message types for RFQ/ PO
    •     Created ZEK1,ZMI and ZEK2 for RFQs
    •     Created ZIK,ZOC,ZOK,ZOM,ZSI, ZSK2 and ZSM for Pos
    •     The above New output types Included with existing Print Forms and Programs but modified with External send(5) medium, and added company’s letter head thru ABAP developments (details provided below)
    •     The above new output types also maintained for Fine- tuned control (thru same navigation) for New(1) and Change(2) operations
          2) Spro – Materials management – Purchasing – Messages – Output control – Message   determination schemas – Define message schema for RFQ/ PO
    •     Maintained the new output types in the control data
    3)     Maintain Condition records for the New out put types (copied same document types from the existing old output types)
    Easy access – Logistics – Materials management – Purchasing – Master data – Messages – MN01 (for RFQs)/ MN04 (for Pos)
    4)     Maintain Email id of Vendor in Vendor master.
    Developments (ABAP):
    1)  Copied the existing print programs and forms of the corresponding out types.
    2) Addition of header window in each corresponding form (HEADER window). Uploaded the HEADER3 graphics in the header window.
    INCLUDE HEADER3 OBJECT GRAPHICS ID BCOL LANGUAGE EN
    3) Added the the following code in TOP includes
                       TYPE-POOLs szadr.
               INCLUDE:  LMEDRUCKF09.
    data: intnast         LIKE snast,
          lvs_recipient   LIKE swotobjid,       "Internet
          lvs_sender      LIKE swotobjid,       "Internet
          lvs_comm_type   TYPE ad_comm,
          lvs_comm_values TYPE szadr_comm_values,
          p_retco         TYPE i.
    5)     Addition of the perform to SOS include for header window display
           PERFORM WRITE_FORM_HEADER.
    *&      Form  WRITE_FORM_HEADER
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_FORM_HEADER.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
       ELEMENT                        = 'HE1'
       FUNCTION                       = 'SET'
       TYPE                           = 'BODY'
       WINDOW                         = 'HEADER'
    IMPORTING
       PENDING_LINES                  =
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
    ENDFORM.
    6)     In the corresponding FORM include the following code has been added.
    DATA:  lvs_comm_type     TYPE   ad_comm,
            lvs_comm_values   TYPE   szadr_comm_values,
            xprogramm         type   sy-repid.
      ... use stratagy to get communication type
          CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
               EXPORTING
                    strategy           = nast-tcode
                    address_number     = lfa1-adrnr
               IMPORTING
                    comm_type          = lvs_comm_type
                    comm_values        = lvs_comm_values
               EXCEPTIONS
                    address_not_exist  = 1
                    person_not_exist   = 2
                    no_comm_type_found = 3
                    internal_error     = 4
                    parameter_error    = 5
                    OTHERS             = 6.
          IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    convert communication data
          MOVE-CORRESPONDING nast TO intnast.
          MOVE sy-repid           TO xprogramm.
    7) By using the function module we can get sender and reciepient mail ids to variables lvs_recipient    lvs_sender
          CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
               EXPORTING
                    pi_comm_type              = lvs_comm_type
                    pi_comm_values            = lvs_comm_values
                    pi_country                = lfa1-land1
                    pi_repid                  = xprogramm
                    pi_snast                  = intnast
               IMPORTING
                    pe_itcpo                  = itcpo
                    pe_device                 = xdevice
                    pe_mail_recipient         = lvs_recipient
                    pe_mail_sender            = lvs_sender
               EXCEPTIONS
                    comm_type_not_supported   = 1
                    recipient_creation_failed = 2
                    sender_creation_failed    = 3
                    OTHERS                    = 4.
          IF sy-subrc <> 0.
          Avoids cancellation with message TD421
            p_retco = '1'.                                           "831984
            PERFORM protocol_update USING '740' space space space space.
          dummy message to make the message appear in the where-used list
            IF 1 = 2.
              MESSAGE S740(me).
            ENDIF.
            EXIT.
          ENDIF.
          IF xdevice = 'MAIL'.                                       "885787
        Check validity of email address to avoid cancellation with TD463
            CALL FUNCTION 'SX_ADDRESS_TO_DEVTYPE'                    "831984
              EXPORTING
                recipient_id            = lvs_recipient
                sender_id               = lvs_sender
              EXCEPTIONS
                err_invalid_route       = 1
                err_system              = 2
                OTHERS                  = 3.
            IF SY-SUBRC <> 0.
              p_retco = '1'.
              PERFORM protocol_update USING '740' space space space space.
           dummy message to make the message appear in the where-used list
              IF 1 = 2.
                MESSAGE S740(me).
              ENDIF.
              EXIT.
            ENDIF.
          ENDIF.
    8)     Attaching the new print program and form in NACE transaction.
    Steps for End user:
    1)     Creating the Purchase Order or RFQ with suitable document type through ME21N or ME41 .
    2)     Executing the transaction ME9F and in selecting the suitable output type.
    3)     Executing the transaction ZSEND_PDOC using INT as input.
    4) With above steps we can able to send purchase order or RFQ to vendor as an attachment through e-mail in PDF format.
    Regards
    Badari

  • Strange characters instead of PDF-file

    when I forward to a servlet called Test.java, my browser return a PDF file.
    but when I write the method of the servlet in a bean, called WinkelWagen.java, and I write the rest of the code of the servlet in a jsp file (pdf.jsp, this jsp calls the method in the bean) I only get strange characters returned by my browser and Acrobat Reader doesn't run.
    the code of the servlet Test.java:
    package be.steppe.cursusdienst.pdf;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.ByteArrayOutputStream;
    import java.io.PrintWriter;
    import be.steppe.cursusdienst.instellingen.Variabelen;
    import be.steppe.cursusdienst.beans.WinkelWagen;
    import be.steppe.cursusdienst.Product;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    public class Test extends HttpServlet
         public Test()
              super();
         public void doGet(HttpServletRequest req, HttpServletResponse resp)
              throws javax.servlet.ServletException, java.io.IOException
              DocumentException ex = null;
              ByteArrayOutputStream baosPDF = null;
              //HttpSession session = req.getSession(true);
              //WinkelWagen ww = (WinkelWagen) req.getAttribute("winkelWagen");
              //Vector vector = new Vector();
              //vector = ww.genereerFormLijst();
              try
                   baosPDF = fix();
                   StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   resp.setHeader("Cache-Control", "max-age=30");
                   resp.setContentType("application/pdf");
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("inline");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   resp.setHeader("Content-disposition",sbContentDispValue.toString());
                   resp.setContentLength(baosPDF.size());
                   ServletOutputStream sos;
                   sos = resp.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
              catch (DocumentException dex)
                   resp.setContentType("text/html");
                   PrintWriter writer = resp.getWriter();
                   writer.println(
                             this.getClass().getName()
                             + " caught an exception: "
                             + dex.getClass().getName()
                             + "<br>");
                   writer.println("<pre>");
                   dex.printStackTrace(writer);
                   writer.println("</pre>");
              finally
                   if (baosPDF != null)
                        baosPDF.reset();
         protected ByteArrayOutputStream fix() throws DocumentException {
              Document doc = new Document();
              ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
              PdfWriter docWriter = null;
              try
                   docWriter = PdfWriter.getInstance(doc, baosPDF);
                   doc.addAuthor(this.getClass().getName());
                   doc.addCreationDate();
                   doc.addProducer();
                   doc.addCreator(Variabelen.getPdfAuteur());
                   doc.addTitle("BESTELLING");
                   doc.setPageSize(PageSize.LETTER);
                   HeaderFooter footer = new HeaderFooter(
                                       new Phrase("BESTELLING     ID:           GEPLAATST DOOR:"),
                                       false);
                   doc.setFooter(footer);
                   doc.open();
    /*                for(int i = 0 ; i < vector.size() ; i++) {
    *                doc.add(new Paragraph( ((Product) vector.elementAt(i)).getProductId() ));
                   doc.add(new Paragraph(
                                  "This document was created on "
                                  + new java.util.Date()));
              catch (DocumentException dex)
                   baosPDF.reset();
                   throw dex;
              finally
                   if (doc != null)
                        doc.close();
                   if (docWriter != null)
                        docWriter.close();
              if (baosPDF.size() < 1)
                   throw new DocumentException(
                        "document has "
                        + baosPDF.size()
                        + " bytes");          
              return baosPDF;
    }The code of the bean:
    package be.steppe.cursusdienst.beans;
    import java.util.Vector;
    import be.steppe.cursusdienst.Product;
    import be.steppe.cursusdienst.FormProduct;
    import java.io.*;
    import be.steppe.cursusdienst.instellingen.Variabelen;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    public class WinkelWagen implements Serializable {
      private Vector producten;
      public WinkelWagen() {
        producten = new Vector();
      public void voegProductToe(Product p) {
        producten.addElement(p);
      public Vector haalProducten() {
        return producten;
      public void verwijderProduct(int pId) {
        for(int i = 0 ; i < producten.size() ; i++) {
          if(pId == ((Product) (producten.elementAt(i))).getProductId()) {
            producten.removeElementAt(i);
            break;
      public void maakWinkelWagenLeeg() {
        producten.removeAllElements();
      public Vector genereerFormLijst() {
        int aantal = 0;
        Vector lijst = new Vector();
        boolean alInLijst;
        for(int i = 0 ; i < producten.size() ; i++) {
          aantal = 0;
          int prodId;
          alInLijst = false;
          Product p = (Product) producten.elementAt(i);
          prodId = p.getProductId();
          for(int l = 0 ; l < lijst.size() ; l++) {
            if(prodId == ((FormProduct) (lijst.elementAt(l))).getProductId()) {
              alInLijst = true;
          if(!alInLijst) {
            for(int q = 0 ; q < producten.size() ; q++) {
              if(prodId == ((Product) (producten.elementAt(q))).getProductId()) {
                aantal++;
            int pId = ((Product) (producten.elementAt(i))).getProductId();
            String tNaam = ((Product) (producten.elementAt(i))).getTypeNaam();
            String tit = ((Product) (producten.elementAt(i))).getTitel();
            String omschr = ((Product) (producten.elementAt(i))).getOmschrijving();
            double pr = ((Product) (producten.elementAt(i))).getPrijs();
            int hoev = ((Product) (producten.elementAt(i))).getStock();
            FormProduct formProduct = new FormProduct(pId,tNaam,tit,omschr,pr,hoev,aantal);
            lijst.addElement(formProduct);
          return lijst;
        public double berekenTotaal() {
          double totaal = 0;
          for(int i = 0 ; i < producten.size() ; i++) {
            Product p = (Product) producten.elementAt(i);
            totaal = totaal + p.getPrijs();
          return totaal;
        public ByteArrayOutputStream fix() throws DocumentException {
             Vector vector = genereerFormLijst();
             Document doc = new Document();
              ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
              PdfWriter docWriter = null;
              try
                   docWriter = PdfWriter.getInstance(doc, baosPDF);
                   doc.addAuthor("author");
                   doc.addCreationDate();
                   doc.addProducer();
                   doc.addCreator(Variabelen.getPdfAuteur());
                   doc.addTitle("BESTELLING");
                   doc.setPageSize(PageSize.LETTER);
                   HeaderFooter footer = new HeaderFooter(
                                       new Phrase("BESTELLING     ID:           GEPLAATST DOOR:"),
                                       false);
                   doc.setFooter(footer);
                   doc.open();
                   for(int i = 0 ; i < vector.size() ; i++) {
                   doc.add(new Paragraph( ((FormProduct) vector.elementAt(i)).getProductId() ));
                   doc.add(new Paragraph(
                                  "This document was created on "
                                  + new java.util.Date()));
              catch (DocumentException dex)
                   baosPDF.reset();
                   throw dex;
              finally
                   if (doc != null)
                        doc.close();
                   if (docWriter != null)
                        docWriter.close();
              if (baosPDF.size() < 1)
                   throw new DocumentException(
                        "document has "
                        + baosPDF.size()
                        + " bytes");          
              return baosPDF;
    }the code of the JSP-file
    <html>
    <head>
    </head>
    <%@ page import="java.io.ByteArrayOutputStream" %>
    <%@ page import="java.io.PrintWriter"%>
    <%@ page import="be.steppe.cursusdienst.instellingen.Variabelen"%>
    <%@ page import="be.steppe.cursusdienst.beans.WinkelWagen"%>
    <%@ page import="be.steppe.cursusdienst.Product"%>
    <%@ page import="java.util.*" %>
    <%@ page import="com.lowagie.text.*" %>
    <%@ page import="com.lowagie.text.pdf.*" %>
    <jsp:useBean class="WinkelWagen" id="winkelWagen" scope="session" />
    <body>
    <%
    ByteArrayOutputStream baosPDF = null;     
    try
                   baosPDF = winkelWagen.fix();
                   StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   response.setHeader("Cache-Control", "max-age=30");
                   response.setContentType("application/pdf");
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("inline");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   response.setHeader("Content-disposition",sbContentDispValue.toString());
                   response.setContentLength(baosPDF.size());
                   ServletOutputStream sos;
                   sos = response.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
              catch (DocumentException dex)
                   response.setContentType("text/html");
                   PrintWriter writer = response.getWriter();
                   writer.println(
                             this.getClass().getName()
                             + " caught an exception: "
                             + dex.getClass().getName()
                             + "<br>");
                   writer.println("<pre>");
                   dex.printStackTrace(writer);
                   writer.println("</pre>");
              finally
                   if (baosPDF != null)
                        baosPDF.reset();
    %>
    </body>
              </html>can anyone please help me out ...
    gr
    Steppe

    ok,
    I removed the html tags in the jsp-file and now acrobat reader does start.
    but it says the pdf file is damaged and cannot be repaired ...
    any ideas?
    gr
    Steppe

  • PDF File Download from a JSP

    I want to have a JSP that will be used to download/display files. I created
              a test.jsp page that tries to return a test.pdf page. Whenever I run it,
              the browser displays some characters and then hangs, but never displays the
              pdf file. If I browse directly to the pdf file it displays fine in the
              browser. What am I doing wrong in this JSP page:
              <%@ page import="java.io.*" %>
              <%
              String mimeType = "application/pdf";
              response.setContentType(mimeType);
              try
              FileInputStream fis = new
              FileInputStream("d:\\work\\internet\\appserver\\presentation\\rdoc\\test.pdf
              ServletOutputStream sos = response.getOutputStream();
              System.out.println("Begin...");
              int i = fis.read();
              while(i != -1)
              sos.write(i);
              i = fis.read();
              sos.flush();
              sos.close();
              fis.close();
              System.out.println("End...");
              catch(Exception e)
              System.out.println(e);
              %>
              

    The JSP will send new lines etc. to the output stream because you have new
              lines in your JSP.
              All right, since you asked, I will have to post my secret source:
              ----- Original Message -----
              From: "Erik Lindquist" <[email protected]>
              Newsgroups: weblogic.developer.interest.jsp
              Sent: Wednesday, June 28, 2000 6:20 PM
              Subject: How to dynamically display images in JSPs
              >
              > This took a little while to figure out so I thought I'd share. After
              > doing some research I was led to the following approach on how to load
              > images from an Oracle database into a JSP:
              >
              > The "main" JSP:
              >
              > <HTML>
              > <head>
              > <title>Image Test</title>
              > </head>
              > <body>
              > <center>
              > hello
              > <P>
              > <img border=0 src="getImage.jsp?filename=2cents.GIF">
              > <P>
              > <img border=0 src="getImage.jsp?filename=dollar.gif">
              > <P>
              > world
              > </body>
              > </HTML>
              >
              >
              > And this is the image getter:
              >
              > <% try {
              > response.setContentType("image/gif");
              > String filename = (String) request.getParameter("filename");
              > java.sql.Connection conn =
              > java.sql.DriverManager.getConnection("jdbc:weblogic:pool:orapool"); //
              > connect to db
              > java.sql.Statement stmt = conn.createStatement();
              > String sql = "select image from testimage where filename = '" +
              > filename + "'";
              > java.sql.ResultSet rs = stmt.executeQuery(sql);
              > if (rs.next()) {
              > byte [] image = rs.getBytes(1);
              > java.io.OutputStream os = response.getOutputStream();
              > os.write(image);
              > os.flush();
              > os.close();
              > }
              > conn.close();
              > }
              > catch (Exception x) { System.out.println(x); }
              > %>
              >
              >
              > The thing to note is that there are no <%@ page import="..." %> or <%@
              > page contentType="..." %> tags - just the single scriptlet. It
              > seems that for every "<%@" the weblogic compiler sees it puts
              > out.print("\r\n"); statements in the generated java source.(???) I
              > don't know much about how browsers work but I think that once it sees
              > flat ascii come at it it treats everything that follows as text/plain
              > which is incorrect for the binary stream that's being sent. Another
              > work around was to set out = null; but that's kind of ugly and might
              > produce server errors. The real fix is to write a bean to handle images
              > which I'll work on next (does anybody have any hints on how to do
              > that?)
              Peace.
              Cameron Purdy
              http://www.tangosol.com
              "Jesse E Tilly" <[email protected]> wrote in message
              news:[email protected]...
              > [email protected] (Cameron Purdy) wrote in
              > <[email protected]>:
              >
              > >Your import will always cause junk to be sent before the PDF. You
              > >should do this as a servlet, not a .jsp.
              >
              > Really? What's the difference between JSP and Servlet as far as writing
              to
              > the response object is concerned?
              >
              > Btw, I forgot to mention that the setContentType should be done as late as
              > possible. It begins the response.
              >
              > Jesse
              

  • Problem opening servlet generated PDF in browser

    This is the code i use to show the PDF in a browser
    ByteArrayOutputStream outStream = new ByteArrayOutputStream();
    res.setContentType("application/pdf");
    res.setHeader("Content-Disposition","inline;Filename= " + file.getName());
    ServletOutputStream sos = res.getOutputStream();
                   outStream.writeTo(sos);
                   sos.flush();          
                   outStream.close();
                   sos.close();
    In Netscape i get an error saying the filename does not start with %PDF and in IE the page just shows up blank. from the blank pagewhen i use the back button and then hit the forward button the pdf will show up in IE.
    I also tries using fileOuput stream instead of servletoutputstream
         FileOutputStream fout = new FileOutputStream( file );
                   outStream.writeTo(fout);
                   fout.close() ;
                   outStream.close() ;
    In this case IE does nothing but it works on netscape or mozilla
    This is running on websphere 5.0 , apache webserver on linux env
    But i need to get this worked on IE any help would be greatly appreciated!
    Thanks in Advance
    Sid

    (SIGH)
    Crossposted over here:
    http://forum.java.sun.com/thread.jspa?threadID=631107

  • Pdf showed in new window. Help needed!

    Hi all,
    This is my first post (but a thousand read), and i want first to thank you all for all the information i have read in this forums for years.
    I have a problem which is giving me more problems that i expected. In my webapp, i want to show a pdf document in a new page of the navigator when a button is pressed. I have discarded the target blank option in the container form because i have others buttons and dont want them to be opened in new windows, just the one that open the pdf.
    So, I used another navigation rule to open a new window. This page have to make de pdf in code an send it to the client. I dont know how to execute that code on the load of the page.
    The solution i am trying is using a poll that only will be called once and in the pollListener execute that code. The problem is that does not work to send the response to the client in the client. Here is the code of the pollListener:
    byte[] file; //Don't worry about it. Contains the file pdf i want to show.
    FacesContext fctx = FacesContext.getCurrentInstance();
    HttpServletResponse response =
    (HttpServletResponse) fctx.getExternalContext().getResponse();
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition",
    "inline; filename=\"file.pdf\"");
    response.setHeader("Cache-Control", "no-cache");
    response.setContentLength(file.length);
    ServletOutputStream sos = response.getOutputStream();
    sos.write(fichero);
    sos.flush();
    sos.close();
    fctx.responseComplete();
    The curious thing is that if i change the content-disposition to atachemement instead inline, it works asking me to download the file, however, i want it to open directly in the new window and is because of that i use content-disposition inline.
    I am almost killing myself because of this problem. Anyone can help me?
    Thanks in advance!

    First of all, you don't need to do this with a workaround using a Poll listener. I assume that one page has a commandButton or commandLink that is used to show the PDF, right?
    Set the useWindow property of the button or link to "true".
    Set the actionListener property of the button or link to a method in a backing bean that looks something like this:
        public void showPDF(ActionEvent actionEvent) throws IOException {
            //Setup the output
            String contentType = "application/pdf";
            FacesContext fc = FacesContext.getCurrentInstance();
            HttpServletResponse response =
                (HttpServletResponse)fc.getExternalContext().getResponse();
            /* Notice that I don't set the Content-Disposition header - inline is default. */
            response.setContentType(contentType);
            ServletOuputStream out = response.getOutputStream();
            /*  Do whatever you need to do to write the pdf to "out" here. */       
            out.flush();
            out.close();
            fc.responseComplete();
        }

  • Servlet generated PDF wont show up in browser

    This is the code i use to show the PDF in a browser
    ByteArrayOutputStream outStream = new ByteArrayOutputStream();
    res.setContentType("application/pdf");
    res.setHeader("Content-Disposition","inline;Filename= " + file.getName());
    ServletOutputStream sos = res.getOutputStream();
                   outStream.writeTo(sos);
                   sos.flush();          
                   outStream.close();
                   sos.close();
    In Netscape i get an error saying the filename does not start with %PDF and in IE the page just shows up blank. from the blank pagewhen i use the back button and then hit the forward button the pdf will show up in IE.
    I also tries using fileOuput stream instead of servletoutputstream
         FileOutputStream fout = new FileOutputStream( file );
                   outStream.writeTo(fout);
                   fout.close() ;
                   outStream.close() ;
    In this case IE does nothing but it works on netscape or mozilla
    This is running on websphere 5.0 , apache webserver on linux env
    But i need to get this worked on IE any help would be greatly appreciated!
    Thanks in Advance
    Sid

    I just skipped posting over the actual pdf write code.
    ByteArrayOutputStream outStream = new ByteArrayOutputStream();
    //Write bytes to the PDF
    writer = createDocument(document, outStream);
    res.setContentType("applicatio�n/pdf");
    res.setHeader("Content-Disposi�tion","inline;Filename= " +
    file.getName());
    ServletOutputStream sos = res.getOutputStream();
    outStream.writeTo(sos);
    sos.flush();
    outStream.close();
    sos.close();
    If i use fileOutputStream i can see that the file is being created physically without any problem. It would not though open up in the Browser!
    Thanks
    Sid

  • I purchased an annual subscription to Acrobat Pro XI and installed two days ago. I cannot open PDFs. I keep getting a dialogue box saying my trial has ended and asking if I want to buy the software. Was using Acrobat Pro 9 previously. It appears even that

    I purchased an annual subscription to Acrobat Pro XI and installed on my Mac two days ago. I cannot open PDFs. I keep getting a dialogue box saying my trial has ended and asking if I want to buy the software. Was using Acrobat Pro 9 previously. It appears even that won't open. SOS!

    Hi Margot ,
    You can click on accept or buy ,which ever option you see on that dialog box.It will prompt you to type in your Adobe Credentials.You can license it by doing the same.
    If it still doesn't work ,follow these steps and see how it goes .
    Delete all the files from following folders:
    [Home]/Library/Application Support/Adobe/SLStore
    [Home]/Library/Application Support/Adobe/SLCache
    And, delete all files from following folder except cache.db
    [Home]/Library/Application Support/Adobe/AdobePCD
    Then launch Acrobat and try to activate and check.
    Regards
    Sukrit Dhingra

  • Opening a PDF through a servlet

    I have been trying to open a PDF document using a servlet for quite a while now and I am making no progress.
    I have gotten the file to pass through to the browser at least 3 different ways, however, when I access the servlet using IE I get an error. The interesting thing is that when I refresh the page, the PDF file opens just fine.
    Is there any trick to doing this? I can use the redirect directly to the PDF file:
    res.sendRedirect("http://localhost:9080/test.pdf");The problem there is that I need the users to bookmark the servlet, not the PDF. In fact I do not even want the user to know where the PDF is.
    Any help is greatly appreciated.

    Dear Mark,
    Perhaps this will help you:
    public void doService (HttpServletRequest request, HttpServletResponse response)
    response.setContentType("application/pdf");
    String contentDisposition = "attachment; filename=\"test.pdf\"";
    response.setHeader ("Content-Disposition", contentDisposition);
    javax.servlet.ServletOutputStream sos = response.getOutputStream();
    java.io.File file = new java.io.File("test.pdf");
    java.io.FileInputStream fis = new java.io.FileInputStream(file);
    byte[] data = new byte[1000];
    while (fis.read(data) != -1)
    sos.write(data);
    sos.close();
    I have not tested the code, but I think you got the idea.
    Greetings Michael

  • Open PDF with commandLink

    Hi,
    I'm trying to generate and open a PDF file in a new window, but i'm having problems showing the file. My main doubt is what to return from the Action method:
    The button:
    <h:commandLink styleClass="commandLink" id="link1" target="_blank" action="#{pc_MyClass.doLink1Action}">
    Open File                                   
    </h:commandLink>The method doLink1Action:
    StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   resp.setContentType("application/x-download");
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("attachment");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   resp.setHeader(
                        "Content-disposition",
                        sbContentDispValue.toString());
                   resp.setContentLength(baosPDF.size());
                   ServletOutputStream sos = resp.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
                   getFacesContext().responseComplete();It generates the PDF, but i don't know how to open it.
    Hope you can help me.
    P.S.: I need a solution that doesn't require invoking servlets.

    I had encountered this problem earlier. Check your server log if you see an IllegalStateException.
    This might be the solution: http://balusc.xs4all.nl/srv/dev-jep-pdf.html

  • Trying to display a pdf inline, in a new window.

    Hello
    I have a servlet with the following html button.
    <FORM NAME=download ACTION=/servlet.ShowReportServlet METHOD=get>
    <INPUT TYPE='submit' VALUE='Display Report A' NAME='Report'>
    When this button is pressed, a pdf file is displayed via the following code
    // Store the uploaded file size
         int filesize = bis.available();
         // Set content type to application/pdf for Adobe Acrobat Reader
         response.setContentType("application/pdf");
         // Content-Disposition is a field to specify presentation of
         // entity or file name (incase Acrobat Reader plug-in not installed)
         response.setHeader(
              "Content-Disposition",
              "inline; filename=\"" + fileToUpload + "\"");
         // Do not cache the pdf file
         response.setHeader("Cache-Control", "no-cache");
         // Set the content length
         response.setContentLength(filesize);
         // Upload the file to the client
         ServletOutputStream sos = response.getOutputStream();
         int data;
         while ((data = bis.read()) != -1) {
              sos.write(data);
    My problem is that I can't work out how to display the pdf in a new browser window.
    Any help would be greatly appreciated.
    Thankyou.

    Thanks for pointing me in the right direction DrClap.
    We ended up with the following html (in an HttpServletResponse):
    <FORM NAME=download ACTION=/servlet.ShowReportServlet METHOD=get TARGET="ReportWindow">
    <INPUT TYPE='submit' VALUE='Display Report A' NAME='Report' OnClick="window.open('','ReportWindow','height=530,width=550,menubar=0,resizable=1,scrollbars=1, status=0,titlebar=0,toolbar=0,left=300,top=100')">

Maybe you are looking for