PDF in browser rendered as Text

We're trying to render SMARTFORMS outpur as PDF within our WebDynpro
application.  We've found several posts which have been very helpful
and I think we're close.  When we try to show the pdf a client browser window
is spawned and the content is rendered as text within the browser (shown below).
It looks like I'm not setting the content-type in the response header correctly. 
Below is the code we're using.
Much Thanks,
Greg
/* Code used to launch browser and view PDF */
  String file_prefix = "rfq";
   IWDCachedWebResource pdfResource = WDWebResource.getPublicCachedWebResource(
                  pdfContent, WDWebResourceType.PDF, WDScopeType.CLIENTSESSION_SCOPE,
                  wdThis.wdGetAPI().getComponent().getDeployableObjectPart(),
                  file_prefix );
   wdComponentAPI.getWindowManager().createExternalWindow( pdfResource.getURL(), "RFQ", false).open();
/* First few lines of rendered document */
DF-1.3
%âãÏÓ
2 0 obj
<<
/Type /FontDescriptor
/Ascent 720
/CapHeight 660
/Descent -270
/Flags 34
/FontBBox [-177 -269 1123 6]
/FontName /Times-Roman
/ItalicAngle 0
/StemV 105
>>

Hi,
Create a separate view to display PDF.
Create a frame on that view and attach its datasource to url.
Please go through the following code.
The return value URL should be used as source for Frame.
  private String convertXstringToUrl( byte[] doc_content, java.lang.String doc_type ) {
          // setIFrameUrl()
       String url = "";
       if (doc_content != null && doc_content.length != 0) {
            MessageManager msgMgr;
            WDWebResourceType webResType = WDWebResourceType.PDF;
            if (doc_type.equals("PDF")) {
                 webResType = WDWebResourceType.PDF;
               } else if (doc_type.equals("HTML")){
                 webResType = WDWebResourceType.HTML;           
            } else if (doc_type.equals("XML")) {
                 webResType = WDWebResourceType.XML;            
            } else {
              try {
                   fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), "WrongDocType", "text", wdThis.wdGetAPI().getTextAccessor().getText("WrongDocType", new String[] { doc_type }));
              } catch(FPMRuntimeException ex) {
            IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);
//            IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType, false);
            try {
                 url = webResource.getURL();
            catch (WDURLException ex) {
                 try {
                      fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), ex);
                 } catch(FPMRuntimeException ex2) {
       } else {
               /** Todo: Error! */
       return (url);
Hope this helps you.
Regards,
Nagaraju Donikena

Similar Messages

  • Open PDF in browser causes blank error box (Windows 7)

    I just freshly installed Windows 7 today. I then installed Adobe Design Premium CS4, including Adobe Acrobat Pro. I use IE8 and Firefox 3.6.
    FYI, this problem does not occur in Windows Vista or lower...only Windows 7.
    The problem is that when I click on links to PDF documents that open in a browser window, a blank error message box will sometimes popup and nothing else happens (see blank error box below). But other times when I click on the same PDF, it will open just fine. I tried opening it four times in a row, and it worked 3/4 times. Then, I did it four times again, and it only worked 1/4 that time. Totally random.
    So I tried clearing the browser cache - no luck.
    Tried reinstalling Adobe Reader 9.3 - no luck.
    Tried uninstalling Adobe.com and Adobe AIR - no luck.
    Tried both IE8 and Firefox - both randomly showed the blank error box.
    The PDF documents are being rendered through PHP, so I also tried changing the PHP header(), but the same blank error box kept randomly showing up.
    What in the world is going on here?

    Guys,
    There is a simple workaround for this. Just DON'T "Display PDF in a Browser". At first I was going to have all the users in my company Right-Mouse Click and Save PDF to their Desktop. But then realized it's just simpler to have the PDF open in the Reader and it gets around the problem fine. This is a great workaround until the whole Windows 7/IE8/Adobe PDF situation mature a bit.
    In case you forgot the instructions from John, here's how:
    Open Adobe Reader or Adobe Acrobat (Pro):
    -> select the menu "Edit"
    -> select "Preferences"
    -> select the Category "Internet"
    -> UNCHECK the "Display PDF in browser"
    This worked for our company. Hope it works for you.
    - Greg H.

  • PDF in-browser will not show attachments panel

    Hi. I'm working with a PDF with attachments. I created it to open with the attachments panel visibile. It works fine except for in Chrome, it shows the PDF in-browser but the attachments panel is not visible. This is causing some problems for our site users.
    What is the solution here. I'm working my IT department to update the .htaccess file to force all PDF files to download, but this seems like an overly complex solution.
    Why won't the attachment panel just show up in Chrome?
    Thanks in advance (if this is not the right forum to ask this, any help would be appreciated)

    That's not exactly helpful, I know I can set my local computer settings . I was looking for a solution to force the download on our users pages. I came up with a solution regardless.
    I just ended updating the .htaccess, adding this command which forces all .pdf files to download versus rendering in the browser, however this is still ignored by Chrome:
    AddType application/octet-stream .pdf
    But since Chrome accepts HTML5, I also added the download attribute:
    <a href="../files/is/2013_EPP_RFP.pdf" download="2013_EPP_RFP.pdf" target="_blank">2013 EPP RFP</a></div>

  • Acrobat renders embedded text unsearchable by spreading out letters: why?

    Something strange happened today when I created a single PDF page of a magazine and inserted it into the larger PDF of the entire magazine: all the letters in the words embedded in the single PDF page were automatically spread out, so this caption, in the single PDF page:
    the commodore just faintly heard the words
    HE WAS NOT MEANT TO HEAR”
    appeared this way, on that same page within the larger PDF document:
    t h e c o m m o d o r e j u s t f a i n t l y h e a r d t h e w o r d s
    HE WA S NOT ME A N T TO H E A R ”
    with white space inserted between most of the letters. This change effectively renders the text unsearchable, since no one is going to insert a space between letters when searching for words in the pdf.
    Does anyone know why this happens? And is there any way of preventing it?  If it helps, this spreading out of letters seems to happen more often in headers and captions than in columns of text.  Thanks!

    Not sure, but were the fonts embedded. It looks like a font issue. You might also try scrolling through the text to see if the spaces are really there.

  • Servlet not streaming PDF to browser properly

    Hello,
    I have a servlet that is processing file uploads and streams the file upload to a browser. All works fine, except that for some reason the browser has it's own mind as to whether or not to load the PDF plugin. Word, excel, text, these files are 100% reliable. However, PDFs sometimes display, other times I get nothing in the browser window. No errors are logged in JBOSS/Apache. Here's a look at my code:
    package com.iw.web;
    import java.io.*;
    import java.util.*;
    import java.io.PrintWriter;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.commons.fileupload.*;
    public class FilePreview extends HttpServlet {
         public FilePreview() {
              super();
         public void destroy() {
              super.destroy(); // Just puts "destroy" string in log
              // Put your code here
         public void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              boolean isMultipart = FileUpload.isMultipartContent(request);
              DiskFileUpload fu = null;
              fu = new DiskFileUpload();
              if(isMultipart)
                   try
                        List fileItems = fu.parseRequest(request);
                        Iterator it = fileItems.iterator();
                   while(it.hasNext())
                        //org.apache.commons.fileupload.
                        FileItem fi = (FileItem)it.next();
                        if (!fi.isFormField())
                             String contentType = fi.getContentType();
                        byte[] data = fi.get();
                             File file = new File(fi.getName());
                             response.setHeader("Content-disposition","filename=" + file.getName());
                        response.setContentType( contentType );
                        response.setContentLength(data.length);
                             //PrintWriter outStream = response.getWriter();
                             //outStream.println(file.getName() );     
                        ServletOutputStream sos = response.getOutputStream();
                        sos.write(data);
                        sos.close();
                   catch(Exception e)
         public void init() throws ServletException {
              // Put your code here

    UPDATE: I have finally figured out my problem and it has nothing to do with the servlet at all. What is in fact happening is that I have jboss running along side IIS and IIS forwards requests to JBOSS/Tomcat. For some reason the connector stops sending the file to tomcat, I suspect based upon file size or timeout something like that. Maybe a timeout config type thing that could be changed in the worker properties?

  • Subpixel rendering of text

    The current options to render text (sharp, crisp, etc) are not good enough.
    Many UI designers work with fonts between 9-13px.  Photoshop's text rendering engine needs an option for subpixel rendering much the same way browers handing text and Flash TLF.  This process introduces color artifacts but the results are sharper, more legible text.

    Do you mean color filter antialiasing?   (all antialiasing is subpixel)
    We can't do that (nor can any image editor that knows what they're doing). Color filter antialiasing only works for final output -- when you know what's being the text, and what display the text is on, what orientation it's being shown at, etc.   That's one reason why the OS makers are dropping color filter antialiasing: it doesn't work well for portable devices, arbitrary displays, new display technologies, composited views, etc.
    And Photoshop CS6's text rendering is much closer to OS and browser rendering without trying to be bug compatible with every minor OS and browser version (yeah, they change text rendering that often).

  • How to create a pdf/a-1b with a text field

    hello, I'm trying to execute a very simple task: create a pdf/a-1b containig a text field.
    using Acrobat XI pro, I created a simple pdf form with 1 form field of type text , then tried to save as pdf/A-1b. The pdf is saved but the form field is removed from resulting pdf.
    Here in detail the steps I made:
    0) configure adobe pdf printer to save as pdf/A-1b
    1) creat a test.txt with notepad
    2) print using acrobat pdf printer
    3) open the generated pdf with Acrobat XI
    4) in 'Standards' panel I see that pdf conform
    5) now go to 'Tools\Modules' and 'Modify'
    6) add a textbox field
    7) exit from 'Modify' mode and save
    8) in 'Standards' panel I see that pdf doesn't conform.
    9) I opened the preflight tool and see two errors
         a) "XMP property for a page object not predefined and no extension schema present".
         page reports the following Trigger values:
         - Extension schema is present in XMP: is not true
         - Property exists in PDF/A Standard: is not true
         b) Form field does not have an appearance dictionary
         page reports the following Trigger values:
         - Form field has an appearance dictionary: is not true
    I'm quite new to Acrobat: simply downloaded the Actobat XI evaluation version, created the file and added the text field. No special settings nor other configurations was applied,
    I'm wondering if someone else was able to reproduce this behavior.
    thank you for any comment

    First, about invalidating the PDF/A. I was told, but never had this confirmed nor tested, that editing a PDF/A will automatically cause the PDF/A status to be deleted from the file. This is because Acrobat does not know about the compatibility of every edit with every current (and future) PDF subset standard, so it is safest just to remove the indicator - if you turn off Adobe's PDF/A view mode which will prevent editing anyway.
    Now, you have a problem with the signatures. Possibly a very big one. Your description "2) fill the text field with some annotations and then sign the signature field 3) save the pdf" is a little too separated. At the time a file is signed it is saved, the hash calculated, and written to the file. So signing and saving are just one action. Yet an unsigned digital signature needs, it seems to me, no appearance.
    I think the solution is a simple one. Sign it, but not with a signature field. If it is PDF/A when you start it is probably PDF/A when you finish. Signature fields seem a distraction and obstacle to the important thing, signing.

  • Acrobat 9 "Display PDF in Browser" on IE7 crashes the browser

    Hi,
    Here's what is happening. My company purchased a few licenses for Adobe Acrobat Professional 9, and they were installed on some of the company laptops. These laptops are in a UAC controlled SOE environment, so the employees are restricted to do any updates/installations that requires rights. The Adobe Professional 9 was installed through SCCM advertisement, and the "Display PDF in Browser" option was enabled.We discovered that when we attempt to download any pdf files off the web, the browser would stop responding/hangs during the duration of the downloads (shown at the status bar of IE), and we can only kill off the process.
    The current workaround is to disable the "Display PDF in Browser" and download the file directly. However, it came to some points where the pdf documents contains some dynamic links over https on the site is is residing. In which case, the pdf have to be open to view from the secured site for the dynamic link to works.
    Previously with Adobe Reader 9, we face no such issue. Only after we installed Acrobat Professional 9, this issue surfaces.
    We have tried uninstalling the Reader before installing the Acrobat to prevent any chances of conflicts, problem persisted.
    Here are the versions of the software involved.
    Adobe Reader v9.3
    Adobe Acrobat Professional v9.0.0
    Internet Explorer v7.0.6002.18005
    I have looked through the forums for similar cases, unless I have missed the keywords, I do not see any similar cases.
    Has anyone encountered similar issues? Would appreciate if you could share on what was done to circumvent this. Thank you!
    Jiang.

    Hi broger_1,
    Thanks for your reply.
    In regards to your query:
    Is the problem seen with both Reader and Acrobat?
    No, this is only seen when Acrobat is install. It is working fine when only Reader is installed.
    What is your definition of a dynamic link? Post example.
    At the moment, I cannot find a online example for reference. I will try to describe by example.
    Let's say if I goes to https://nonexistance_site.com/brochure_ folder/broc_1.pdf, and the "Display PDF in Browser" was already enabled.
    The content of the broc_1.pdf contains a hyperlink that points to "../broc_2.html"
    Our issue now is the we can only download the pdf file to a folder, say c:/pdfs/broc_1.pdf, so when we tried to access the dynamic link, it will tries to locate c:/pdfs/broc_2.html, which is non-existence. And direct access to https://nonexistance_site.com/brochure_ folder/broc_2.html would not work for some reason (possibily session restriction, or something else).
    What are your security settings? (is Enhanced Security enabled?)
    This setting is currently disabled in the Acrobat Pro 9 preference. Should this stays as disabled?
    This only happens when attempting to "download & display" any pdf files from the net, displaying of local pdf that is already downloaded is fine.

  • Adobe Reader X - Disable "Display PDF in Browser" via Registry

    I'm trying to configure my organization's Windows workstations so that web-based PDF files open in Adobe Reader rather than in internet browsers. I have been able to configure Adobe Reader 9 installations to open web-based PDF files in Reader rather than internet browsers by using the following registry setting:
    Hive
    HKEY_CURRENT_USER
    Key path
    Software\Adobe\Acrobat Reader\9.0\Originals
    Value name
    bBrowserIntegration
    Value type
    REG_DWORD
    Value data
    0x0 (0)
    My problem lies with Adobe Reader X: I used the following settings in attempting to prevent Adobe Reader X installations from opening web-based PDFs in internet browsers:
    Hive
    HKEY_CURRENT_USER
    Key path
    Software\Adobe\Acrobat Reader\10.0\Originals
    Value name
    bBrowserIntegration
    Value type
    REG_DWORD
    Value data
    0x0 (0)
    Hive
    HKEY_CURRENT_USER
    Key path
    Software\Adobe\Acrobat Reader\10.0\Originals
    Value name
    bAllowByteRangeRequests
    Value type
    REG_DWORD
    Value data
    0x0 (0)
    Hive
    HKEY_CURRENT_USER
    Key path
    Software\Adobe\Acrobat Reader\10.0\AVGeneral
    Value name
    bBrowserDisplayInReadMode
    Value type
    REG_DWORD
    Value data
    0x0 (0)
    I've only had partial success, though. Internet Explorer respects the registry settings and opens web-based PDFs in Reader X. Firefox 14.0.1, though, ignores the registry settings and opens web-based PDFs in Firefox.
    Is there a different registry setting I should be using so that Firefox sees "Display PDF in Browser" unchecked and allows web-based PDFs to be opened in Reader X? Is there another method I should be following for deploying this setting to Adobe Reader X clients?

    Hi,
    We'll, you've educated yourself well. Unfortunately, Acrobat products can't control what browsers do so uniform behavior is not possible.  The setting is Adobe's best attempt and forcing some consistency.
    The ReadMode setting only controls what happens in the UI after the PDF is open.
    Ben

  • Display PDF in Browser(Embed PDF In IE 6)

    Hi All,
    I am Stuck in solving the below problem. 
    I am trying to dispaly the PDF in IE Browser 6, but i am getting the below error. Strange thing the same is working in IE 8.  
    "adobe Reader couldnot open 'A9R6B.tmp' becuase it is ither not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decode)." 
    System Details:
    1. Windows XP
    2. Adobe Reader 9
    3. Using Weblogic Applicaiton  server
    4. Internet Explorer 6
    Note:
    1) I trying checking "Display PDF in browser" opiton in Adobe Reader ->Perferences -> Internet->  ---- But it did not work
    2) I trying uncecking "Display PDF" in browser option in Adobe Reader ->Perferences -> Internet->  its worked but not embeded into the IE. It has opened seperatelly.
    kindly help me by providied some clue to slove the above problem.
    Thanks in advance
    SIMHA

    What is your operating system?  Browser?  Reader version?

  • Display PDF in Browser Option

    I am able to open a PDF file from a particular protected Website. I can fill in the required info, but when I attempt to Save/File it back to the site, the following pops up: "For security reasons your return could not be saved. Please ensure that the 'Display PDF in Browser' option is selected under the Edit-Preferences-Internet Settings in Adobe Reader."
    Adobe Reader XI, Internet Explorer 10 & Windows 7 are loaded on my PC.
    I cannot trace 'Display PDF in Browser' under settings, but using Tools>Manage Add-ons>Toolbars and Extensions>Show>All Add-ons, I can see that 'Open PDFs in the Browser' is Enabled.
    I also used the Registry Editor: Adobe>Reader>exe to confirm the Name, Type & Data in the string value: (ab), REG_SZ, C:\Program Files\(x86)\Adobe\Reader11.0\Reader\AcroRd32.exe
    No help is forthcoming from the Website, despite me logging a call to their service centre
    Does the problem lie at my end, or the Website?

    Hi Ben,
    I manually added the registry setting but it made no difference.
    I uninstalled 10.1.4 and reinstalled 10.1.3 and with 10.1.3 I am able to view a PDF in IE when launched from the command line.
    I re-downloaded and reinstalled 10.1.4 and retried and now I can view a PDF in IE when launched from the command line.
    Strange.
    Regards
    Craig

  • Display PDF in browser issue in 9.1.1

    We deployed the 9.1.1 msp update to all of our clients but we realized that it unchecks "Display PDF in browser," so now I need to figure out how to get that checkbox rechecked for every current user and any new user that logs on.
    I know that all I need to do is delete bBrowserIntegration in HKCU\Software\Adobe\Acrobat Reader\9.0\Originals but this will only change for the currently logged on user. For shared machines that we currently have deployed in our environment how to I  change this setting for all of the users that are currently not logged on or for any future users that may log on?
    Thanks for any help.

    I would create a script to go into the active setup folder that will run when each user logs in.  Appdeploy is a good website for stuff like this.  Here is a link that will might be able to help you create a active setup script if you're not sure.
    http://www.appdeploy.com/articles/activesetup.asp

  • 'Display PDF in browser' whats the default?

    Can anyone tell me definitively what the current default setting has been for whether Preferences/Internet Options/'Display PDF in browser' is checked or unchecked?
    I'm curious to know as well if it has changed with 8, 9, and 10?

    For all three the default is "checked".
    Be well...

  • "Display PDF in Browser" setting - $500 reward for the solution

    The corporate policy requires the "Display PDF in Browser" setting to be unchecked for all applications, this is to open the PDF document in new reader instance but our specific application needs the reader to be opened in the same browser even if the preference "Display PDF in Browser" is unchecked.... The setPreference from javascript (html) doesn't seemed to work... How do i make this work? I am looking for programatic way to set this preference in HTML javasript or Java Applet or ActiveX or any other means. I am currently using JS and Object tag, the only functions that we need at this point are page navigation and getting current page using JS.
    Also, I need the links the browser to open in new browser once the PDF is loaded... do I need to reset the preference once it is loaded for the links to open in new browser? How can this be progrmatically achieved without altering the original PDFs?
    I realize that this may be difficult and am looking for workarounds or alternate solutions to meet my req. $500 for anyone who could can provide solution.. Please email me [email protected]
    thanks,
    - Ray

    Convince your IT people to allow folks to set their preference to display in browser.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Sun, 13 Nov 2011 14:58:23 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: "Display PDF in Browser" setting - $500 reward for the solution
    Re: "Display PDF in Browser" setting - $500 reward for the solution
    created by pdf_disp_issue<http://forums.adobe.com/people/pdf_disp_issue> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4023302#4023302

  • Issues with Display PDF in Browser option

    We've recently hit a problem with our application that used to successfully display PDFs in a web browser control. In Adobe Reader 9.x it worked no problem. In Adobe Reader 10.1.3, it stopped working. I'm working along the line that it is something to do with the interaction between the ActiveX viewer and Internet Explorer when in a Citrix environment. (IE is version 8, OS is Windows 2003 Server). To help determine it was the Citrix element that was the cause, with the 'Display PDF in Browser' option active and using Adobe Reader 10.1.3 I launched IE from a command window passing the pdf file name as an argument and the PDF was successfully displayed in the IE browser. Now Adobe Reader 10.1.4 the latter is no longer working; the PDF is always displayed in the Adober viewer.
    Has Display PDF in Browser been effectively disabled in 10.1.4?
    If it should work as before, what can I do to restore the situation?
    TIA
    Craig

    Hi Ben,
    I manually added the registry setting but it made no difference.
    I uninstalled 10.1.4 and reinstalled 10.1.3 and with 10.1.3 I am able to view a PDF in IE when launched from the command line.
    I re-downloaded and reinstalled 10.1.4 and retried and now I can view a PDF in IE when launched from the command line.
    Strange.
    Regards
    Craig

Maybe you are looking for

  • How could i retrieve a document sent to my printer's email

    how could i retrieve a document sent to my printer's email

  • Uninstalling  BTjunkie toolbar  in Safari

    Hi, i wonder if there is a way to uninstall BTjunkie toolbar in Safari. Their website only has solutions for IE and FIrefox, and nothing for Safari on the Mac. I thought reinstalling Safari would do it, but it didn't for me. Thank you very much.

  • Collection help

    I have a timecard application where I use a header and some collection regions to capture employee data. I have the header working just fine as well as the first collection region, but I can't seem to get the second collection region to update proper

  • Waking laptop from sleep, ffx lost all icons, (bookmarks, navigation, stop/reload, download and extension icons.

    windows 8.1 update one. laptop goes to sleep mode, upon starting the laptop up again, i lose all icons of firefox i.e. the forward/back navigation buttons(still there and clickable but now black arrow) download icon, and bookmark icons. all buttons s

  • Using Edirol PCR keyboard with Logic

    I was wondering if anyone has had any experience using Logic with an Edirol PCR midi keyboard. From what I understand you can program the keyboard using Edirols software editor or using key mapping in Logic. I looks like it would be a lot easier to u