Application/pdf problem

Hello!
Well I have noticed some strange behaviour when sending application/pdf data to browser.
I'm using servlet & Lowagie iText components to build pdf. With help of ServletOutputStream, pdf is sent to browser. But browser, after pdf is generated, and output stream is posted (ServletOutputStream post method), generates another HTTP request header.
I thought this could be a problem with opening new browser window (on link that calls servlet I'm using target="_blank"), but same thing happends with call inside same browser window.
Algorithm which creates pdf doc. is quite big and needs some time to calculate all the data for pdf. It's waste of time to call this alg. twice...
If this is some kind of bug, how to avoid calling same alg. twice (browser is calling same http address twice)??

Hello.
Maybe that helps you.
http://www.lowagie.com/iText/faq.html#msie

Similar Messages

  • Problem with PDF attachment - need to send as "application/pdf" - Urgent!

    I have code to email a created PDF but when the email is received the attachment is being removed by some kind of SMTPO firewall (I assume at my ISP). It says that attachment type "application/octet" with that file extension (.pdf) is not allowed. How do I set the mime type of the attachment to be "application/pdf"?
    My code I use is similar to this at the moment:-
    // Part one is the text
    BodyPart bodyPart = new MimeBodyPart();
    bodyPart.setText("Some text");
    multipart.addBodyPart(bodyPart);
    // Part two is the attachment
    bodyPart = new MimeBodyPart();
    DataSource sourceFile = new FileDataSource(FileName);
    bodyPart.setDataHandler(new DataHandler(sourceFile));
    bodyPart.setFileName("FileName.pdf");
    multipart.addBodyPart(bodyPart);
    message.setContent(multipart);Any help would be greatly apprecieated as I need to fix asap!!!

    i tried like this,but it will giving error like this
    javax.mail.MessagingException: IOException while sending message;
    nested exception is:
                        javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf
    my code is :
    MimeBodyPart pdfpart=new MimeBodyPart();
    pdfpart.setContent(message,"application/pdf");
    pdfpart.addHeaderLine("Content-Type: application/pdf; charset=\"iso-8859-1\"");
    pdfpart.addHeaderLine("Content-Transfer-Encoding: quoted-printable");
    Multipart mp2=new MimeMultipart();
    for( int i = 0; i < m_attachments.length; i++ )
    // attachments= str+"/"+attachments[i];
    MimeBodyPart messageBodyPart = new MimeBodyPart();
    DataSource fileDataSource =new FileDataSource(m_attachments[i]);
    InputStream fi = fileDataSource.getInputStream();
    DataSource fileDataSource1 = new ByteArrayDataSource(fi, "application/pdf");
    messageBodyPart.setDataHandler(new DataHandler(fileDataSource1));
    // messageBodyPart.setFileName(attachments[i]);
    messageBodyPart.setFileName(m_attachments[i].getName());
    mp2.addBodyPart(messageBodyPart);

  • IE5.5 / PDF Problem

    Software: W2K, IE5.5, Acrobat Reader 5.0, Weblogic Server 6.0, FOP
              0.20.1
              I'm having a problem getting a FOP 0.20.1 pdf file to be displayed
              within IE5.5. The pdf is being produced on Weblogic Server 6.0 using
              a jsp, which employs a tag and an ejb to do the FOP transformation.
              After invoking the jsp from the browser, the Acrobat splash screen
              briefly appears, but the IE window ends up being blank and doesn't
              display the pdf. Curiously, the jsp response is written to the
              "Temporary Internet Files" folder with a jsp extension. When I paste
              it onto the desktop, it then has a pdf extension and can be
              successfully opened by Acrobat.
              I've found two work-arounds: 1) serialize the pdf file on the server
              side and then use a redirect to successfully access it (i.e.,
              in-place-activation in IE5 then works); 2) deselect the "Display PDF
              in Browser" option in Acrobat and get the pdf file to be displayed in
              a separate Acrobat window. However, these work-arounds don't meet our
              requirements.
              I've accessed the Microsoft, Adobe and BEA websites to find a solution
              to this. BEA does have a document which explains that Weblogic Server
              will write blank lines at the top of the file returned by the server
              due to successive tags on separate lines at the top of the jsp file.
              The problem can be avoided by putting these tags on the same line,
              which I did. Before doing so, IE displayed the raw file. After the
              "fix", all I got was the blank screen.
              Interestingly enough, Netscape seems impervious to this problem. The
              pdf is embedded within the browser window, even with the blank lines
              at the top of the file returned by the server.
              I've uninstalled/reinstalled Acrobat, upgraded IE5.5 so that it has
              the latest patches, and have tried using IE 5.5 from several different
              machines, all with no success.
              Any help with this would be greatly appreciated ....
              Chris W.
              

    Send more details:
              Presumably you are sending the PDF to the browser by writing it to the
              response.getOutputStream ?
              Are you setting the mime type to "application/pdf" ?
              Try setting to mime type to text and looking at what is displayed on the
              browser. If there are any stray carriage returns in the response (caused by
              Weblogic JSP processor when it does an import) you will see that the first
              bytes of the first line are not
              %PDF
              so Acrobat can become confused. If this is the case check the bea site for
              how to remove these stray carriage returns.
              John Farrow
              www.xmlpdf.com PDF creation from Java
              "Eric" <[email protected]> wrote in message
              news:[email protected]...
              > [email protected] (Chris W.) wrote in message
              news:<[email protected]>...
              > > Software: W2K, IE5.5, Acrobat Reader 5.0, Weblogic Server 6.0, FOP
              > > 0.20.1
              > >
              > > I'm having a problem getting a FOP 0.20.1 pdf file to be displayed
              > > within IE5.5. The pdf is being produced on Weblogic Server 6.0 using
              > > a jsp, which employs a tag and an ejb to do the FOP transformation.
              > > After invoking the jsp from the browser, the Acrobat splash screen
              > > briefly appears, but the IE window ends up being blank and doesn't
              > > display the pdf. Curiously, the jsp response is written to the
              > > "Temporary Internet Files" folder with a jsp extension. When I paste
              > > it onto the desktop, it then has a pdf extension and can be
              > > successfully opened by Acrobat.
              > >
              > > I've found two work-arounds: 1) serialize the pdf file on the server
              > > side and then use a redirect to successfully access it (i.e.,
              > > in-place-activation in IE5 then works); 2) deselect the "Display PDF
              > > in Browser" option in Acrobat and get the pdf file to be displayed in
              > > a separate Acrobat window. However, these work-arounds don't meet our
              > > requirements.
              > >
              > > I've accessed the Microsoft, Adobe and BEA websites to find a solution
              > > to this. BEA does have a document which explains that Weblogic Server
              > > will write blank lines at the top of the file returned by the server
              > > due to successive tags on separate lines at the top of the jsp file.
              > > The problem can be avoided by putting these tags on the same line,
              > > which I did. Before doing so, IE displayed the raw file. After the
              > > "fix", all I got was the blank screen.
              > >
              > > Interestingly enough, Netscape seems impervious to this problem. The
              > > pdf is embedded within the browser window, even with the blank lines
              > > at the top of the file returned by the server.
              > >
              > > I've uninstalled/reinstalled Acrobat, upgraded IE5.5 so that it has
              > > the latest patches, and have tried using IE 5.5 from several different
              > > machines, all with no success.
              > >
              > > Any help with this would be greatly appreciated ....
              > >
              > > Chris W.
              >
              > I have the same problem, I'll try to fix it and give you some news, if
              > you find any solution send me an e-mail to [email protected]
              

  • Indian language file - pdf problem

    I work mostly with Indian langauges fonts and have ttf (and some ATM) fonts.
    When I try to make pdf for printing purposes, some characters do not appear in pdf. I found from the character map that they are equivalent to "no-break space" character. And in some languages (fonts), the same character appears perfectly.
    I use acrobat distiller to make pdf for prepress. (It is another problem that sometimes such characters do not appear even in normal word file.)
    Is there any solution to solve this problem, because, this problem appears in almost all Indian fonts.
    Interestingly, a pdf can be prepared from the same file with the Windows98 version.
    I have posted the same question (shorter one) at pdf forum as well.
    Can anyone help?

    We experienced the exact same problem as the OP (including corrupt files named "f.pdf" and the browser dialog box he documented). Don't know if his environment is similar, but here is how we fixed our issue:
    Our app uses an Authentication Scheme that includes under "Page Session Management" a "Session Verify Function" called like this: "return timeout_pkg.check_timeout;". This timeout_pkg I think came from code originally posted here, it works well so thanks to the original coder. However it does present a small issue in that it rewrites the mime headers in the server response in one use case. Since it is rewriting the headers to "text/html" even though we are sending back a report where the mime header should be "application/pdf", the client gets confused and the result is the symptoms the OP posted.
    So if we change the timeout package and body so the signature is like this: "function check_timeout (p_request IN VARCHAR2 DEFAULT null) return boolean;"
    And change the call in the "Session Verify Function" to pass the request as a parameter like: "return timeout_pkg.check_timeout(:REQUEST);"
    And change the body of the timeout_pkg.check_timeout function to use the correct mime type when calling a report:
    elsif not g_cookie_already_sent then
    if (p_request is not null and INSTR(p_request, 'PRINT_REPORT') != 0) then
    owa_util.mime_header('application/pdf', FALSE);
    else
         owa_util.mime_header('text/html', FALSE);
         end if;
    then we solve our particular problem... I hope this saves somebody else some time, remember this was our specific solution to the exact symptoms documented by the OP, however as a general rule I would say if you are experiencing problems with pdf printing from Apex, watch out for anything your app might be doing with the owa_util pkg in particular and mime headers in the server response in general.
    Edited by: cmcneil on Sep 5, 2008 11:45 AM
    Edited by: cmcneil on Sep 5, 2008 11:59 AM

  • For uploading PDF (in php) if (!=application/pdf) {"No PDF"} gives error when trying to upload PDF. Why?

    In a php upload file I have inserted:
    if($_FILES['file']['type'] !="application/pdf"){ echo "Should be PDF";}
    exit;
    Even when trying to upload a PDF file the error message comes: Should be PDF.
    Earlier this worked fine. Maybe a bug in an update?
    Regards,
    pluys

    I think I found part of a solution now. It is not Firefox, it is some add-on or plug-in. I myself use a lot of add-ons. I asked someone who was new to Firefox to load up a PDF file. There was no problem!
    So now I'm going to check all my add-ons, hoping it is not Firebug.
    All the best,
    Pluys

  • Preview Application Resizing Problem

    Preview Application Resizing Problem
    Microsoft platforms have two significant advantages. The first is the concept of an operating system that can function with hardware that ranges from cellular phones to desktop computers. The second is that Microsoft has excellent software development tools
    for creating and testing computer programs.
    Software compatibility across hardware platforms requires not only meeting CPU and memory requirements. Application programs must be able to automatically adjust Window and control sizes to meet the needs of available window sizes, video display unit sizes
    and screen resolutions, switching between vertical and horizontal viewing, vertical and horizontal scrolling, changes in font sizes , and variations in the available screen space due to usage of vertical and horizontal toolbars.
     Software developers must be careful that resizing doesn’t squeeze controls too close together or make them so small that they cannot be finger or stylus selected when used with touch screens.
    Some of the required automatic resizing options are provided by the Microsoft software compilers and the Windows operating system.  Softgroup Component’s “.NET  Forms Resize” is an example of one of the third party applications that provide advanced
    resizing functionality.
    Many of the resizing functions are programmer options and, if not properly enabled, an application may not have the required resizing functionality. At the current state of the art, application programs are highly variable in their capability to do the “intelligent
    resizing” that is required to handle different display environments.
    A case in point is the Microsoft Preview Application for Windows 10. When entering lengthy comments, the send button becomes positioned off the end of the program window. It is possible to scroll to the button, but the display automatically resets when scroll
    is released. The result is that the text cannot be sent. You can try a "blind" TAB to the SEND button. This appeared to work after several tries, but the comment was apparently not received,
    RERThird

    Hi,
    What do you see when you open the same PDF file in Acrobat Reader? Are the words still squeezed than?
    Dimaxum

  • I wish to upload a PDF file to my website but Firefox 3.6.12 reports it as type application/force-download and NOT application/pdf, WHY?

    My website has been running for many months, and as part of the site users can upload PDF documents to share with others. The last successful upload was 5th Nov, but to-day my upload was rejected because Firefox returned the document type as application/force-download rather than application/pdf. Uploads work fine with IE8.
    The site uses PHP to check extension and document type and, as I mentioned, has worked fine for many months. I have even attempted to upload the same document that succeeded on the 5th, but again Firefox returns application/force-download as the document type.
    Why the change?

    Just found a solution.
    In Tools, Options, Application Firefox listed TWO options against Adobe Acrobat Documents; the apprliaction/pdf and application/force-download. I have deleted mimeTypes.rdf and allowed Firefox to re-create the file. All works as it should now!

  • PDF problems in Acrobat 9 Pro

    PDF problems in Acrobat 9 Pro
    I'm using windows 7, 64 bit version
    What can be the cause of dots, where underground otherwise white appearance with small black dots.
    They do not come with the pressure. but is rather confusing.
    Mox
    PDF problems in Acrobat 9 Pro
    here's an example of the dots, and yes I have updated acrobat

    You're asking a lot of ancient Acrobat to work with an Office that never existed when it was made. "Just updated my office suite" is a massive change, and Window 8 didn't exist at that time either...

  • Why can't I send a fill in application (PDF file)?

    I can't send a fill in application (PDF file) in Adobe Reader from my Mac (version 11.0.04), but it works fine from my PC (version 11.0.05). Why?
    I get this massage (danish):
    "Der opstod en fejl under afsendelsen: Indhold af typen text/html; charset=utf-8 kan ikke behandles."
    How do I get it to work?

    It doesn't go through my emil. The PDF file just connects to the internet and "sends" is.
    On the picture, you can se the button I press (underneath the message box), and in the corner you can see it trying to send the data.  

  • PDF problem part 2...

    I guess a lot of people are having pdf problems.
    When I export a pdf of a Travel Journal doc and view with adobe reader 7.0, the borders on the photos are not there.
    What is the word on this?
    As you can see I don't have Tiger /PDF-X.
    Thanks

    Not certain if this is quite the same thing, but.......
    I have found problems when exporting to pdf, not when I open in Preview but when the person I am emailing the file to opens it in Acrobat, as all drop shadows are then lost, this makes professional printing difficult.
    Resolved it for the moment by:
    1. exporting to pdf as normal
    2. using Graphic Converter which comes bundled with OSX to create a PSD file and sending that electronically. Slight problem was that the size of the file increased from 3mb to about 27mb, so had to download a free copy of Cyberduck ftp programme too. In fact saving it to jpeg was just about as good.
    3. you do have to do one page at a time but it works.

  • Application Builder problem on one server but not another

    I am having an Application Builder problem. When I get into App Express and go inside the builder and try to edit a listed application, I get an “http 404 the page cannot be found. The page might have had its name changed or is temporarily unavailable” situation. I can get into SQL commands, utilities, and administrative activities. I can also run the application. Also, if I go onto a different server with App Express on it, I can get into the builder and edit applications with no trouble. Our DBA had the server in question rebooted a little over a week ago and that took care of the problem for a couple days. Any ideas? Is this an Express problem or a server problem? He had also tried restarting Express before he had the reboot done and that didn’t help.
    Thank you for any help.
    Cordially,
    Robert J. Smith

    I have messages from the Apache error log files from the dates I was getting the builder error. For future reference, I will post them below. The builder has been working fine lately.
    Robert Smith
    ** error log messages follow **
    [Mon Jul 16 07:25:12 2007] [error] [client 147.159.5.134] [ecid: 
    79143788610,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/java/awt/KeyboardFocusManager.class
    [Mon Jul 16 07:25:12 2007] [error] [client 147.159.5.134] [ecid: 
    79143788611,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/java/awt/event/MouseWheelListener.class
    [Mon Jul 16 07:25:13 2007] [error] [client 147.159.5.134] [ecid: 
    83438757083,1] File does not exist:
    /app/oracle/oraappsrv10g/forms/java/oracle/forms/registry/default.dat

  • Firefox 17.0 for Mac OS X missing Preferences- Applications- Preview Doc (application/PDF) entry to set behavior for PDF files

    I want to set Firefox to automatically download or save a PDF without the panel coming up to ask me. However, when I go to Firefox->Preferences->Applications there is no entry for PDF files to set it to open or save the file without asking me (i.e., no Preview Document (application/PDF).
    I am using Firefox 17.0 with Mac OS X 10.6.8 using Intel Core 2 Duo

    I have .pdf associated with Preview. The issue is that in Firefox->Preferences-> Application tab does NOT contain an entry for Preview Document ((application/PDF) which is needed to do an association that will occur automatically every time Firefox encounters a doc of that type. (the application tab has Preview Document (image/<6 types>) but no entry for the PDF format.

  • Windows Application - PDF Viewer

    Hi,
    We are using windows application PDF viewer with Acrobat API. The pdf document is loading correctly without issues but the Tool menu is not displayed.
    How to include tool menu in wondows form (PDF Viewer).

    There is no in-box PDF API on Windows Phone 8.1.
    The typical approach is to launch the pdf file into the default PDF viewer app. If you want to display it inside your app you'll need to either find a 3rd party component or write your own.

  • ASP application has problems working with oracle database 8.1.7

    ASP application has problems working with oracle database 8.1.7 through both oracle ODBC driver and Microsoft ODBC driver
    We have an ASP application running on Windows 2000 server, and with 8.1.7 Net8Client and MDAC 2.6 SP1.
    The application worked fine with an Oracle 8.0.5 database.
    After upgrading oracle database to 8.1.7.0.0, our ASP application works fine except when updating the same data record more than once. The application is not saving our updates.
    We tested our application using Oracles ODBC driver v8.1.7.5.0
    and experienced more problems. We had problems just bring up our data entry pages. In either case, we are returned with some 505 errors in our browser, problems with the ASP pages and IIS, the page is not displaying.
    If anyone has some suggestions on how to fix my problem, please advise. Thanks in advance.

    thanks...i saw one article with this approach..but the document did not present the detailed process...do you have one? i am still searching for a good procedure to follow...since it is an old database and focusing/studying old versions like this is a pain in the a**... :(

  • Application Language Problem

    Hello,
    I am writing From Turkey. I have an iphone 5s and i believe i am the one of first iphone 5s buyer in Turkey.
    I had a problem and i called apple and nobody solved my problem. I tunes help desk or whatever thay said that problem is not their problem its applications developers problem...
    I am explaining my problem :
    I downloaded Skype, ICQ ,Air Wings, Shazam , And some of other applications but its koming with japanese language. I change my prefered language to Turkish and my location is also choosen Turkey. But I have still the same problem.
    I tunes help desk gave me these link below to solve my problem.
    If Apple keep telling me that this is not their problem i am going to change my iphone and my all families phone to another brand...
    ICQ – Free Calls and Messages support url is http://www.icq.com/support/
    Air Wings® support url is http://www.pangeasoft.net/support.html
    Shazam Version 15244739; support url is http://www.shazam.com/music/web/faqs.html?
    When i seach from google this problem happens to other people...

    Hi
    I am not sure but it may be fixed from the portal during WebDynpro ABAP iView creation. Please contact your portal admin for this.
    Thanks
    Vishal kapoor

Maybe you are looking for