Pdf file handling

Hi,
I am trying to read pdf file in String, process the string and then put the string back in a new pdf file. The code I am using is as follows:
Reading pdf file:
String readFile() throws Exception
     InputStream istr = getClass().getResourceAsStream("26-1880.pdf");
     StringBuffer buff = new StringBuffer();
int someByte=0;
     for(int i=0 ; ; i++)
          try
               someByte = istr.read();
          catch(IOException ioe)
               ioe.printStackTrace();
          if(someByte == -1)
          break;
          buff.append((char)someByte);
return (buff.toString());
Writing string to pdf:
void writeFile(String file) throws Exception
     OutputStream ostr = new FileOutputStream(new File("VALoan.pdf"));
     byte[] someByte=file.getBytes();
     ostr.write(someByte);
     ostr.flush();
     ostr.close();
But the new file that I generate does not become valid pdf file.
Also right now, I am not even processing the string that I get from a pdf file. I just get and put it back.
Can anyone find out what could be the problem?
Thanks,
-Stan

Hi Vanilla,
I want to process the string that I get from the pdf.What do you mean "process"? What are you planning to do with it?
And it is NOT a String. If you want a String representation (e.g., just the text, with no layout, font, etc. info), then you'd need to interpret the BYTES first and then build a String from the results.
I can not process the bytes. So I think, I have to
convert the bytes into string.Then you need to either learn the PDF spec and write code to interpret those bytes, or you need to find a 3rd party library that does this. You can't just expect to read the bytes into a Java String and have it work.

Similar Messages

  • PDF file handling through BPEL

    Hi,
    We are exploring BPEL as an option to handle PDF files generated by Oracle EBS (BI Publisher). Basically we want to achieve following:
    Pick up PDF files from certain location on UNIX box and then
    a. Spliting the PDF file into two or more files (depending on some data on PDF file itself, say customer number)
    b. FTP few of the splitted files to certain location on UNIX
    c. Print few of the splitted files onto a predefined network printer
    d. Upload PDF files in Oracle database (BLOB)
    e. Email/Fax PDF files as attachment to one or more recipient
    I understand this may be a weird requirement but it would be great if we can take advantage of BPEL flexible process management capabilities.
    Please give your inputs (whatever possible) as to whether above listed tasks are possible or not?
    br

    Hi Vanilla,
    I want to process the string that I get from the pdf.What do you mean "process"? What are you planning to do with it?
    And it is NOT a String. If you want a String representation (e.g., just the text, with no layout, font, etc. info), then you'd need to interpret the BYTES first and then build a String from the results.
    I can not process the bytes. So I think, I have to
    convert the bytes into string.Then you need to either learn the PDF spec and write code to interpret those bytes, or you need to find a 3rd party library that does this. You can't just expect to read the bytes into a Java String and have it work.

  • Raise without Handler error when printing pdf files in Outlook

    At work sometimes I'm asked to print emails with tons of attachments, but when I attempt to print the email with the attachments through outlook, anytime there is a PDF attached, I get the "Raise without Handler!" error and also the following window:
    The only way I'm able to print the PDF file is by opening the file directly and then printing it from the actual Acrobat program. At work we use Acrobat 7.0 Professional.
    Any help would be greatly appreciated as it's pretty time consuming when I'm printing an email with 20+ PDF attachments.

    Hi Hisami,
    Hope you are well.
    Latest adobe & chrome versions. IE is an older version.
    OS Windows home premium 7
    Adobe Reader X1
    Does adobe have chat?
    Bit of background:
    I have a monthly subscribtion with adope create and everything was working fine. Then I downloaded a free trial of I think acrobat so I could edit pdf and around the time I got a redirect virus on google chrome. So I deleted all adobe and used Norton power cleaner.
    Then tried download (reinstall) adobe create. Now I can't open any of my many pdf files. Just get 'Raise without handler".
    Thanks for looking into this,
    Andrew

  • Handle the "No matches were found." when doing a search in Adobe Acrobat PDF file.

    I have written an Excel spread sheet and using visual basic coding in my macro can open an as needed PDF file, search for a paragraph number as copied from the spread sheet, capture the page in the PDF file it is found on and paste the "pagefound" back into my Excel spreadsheet where desired. In some cases, however, Adobe Acrobat Professional XI reports back that "No matches were found."
    Is there any way to handle the display of this message using Visual Basic Coding so that I can set my pagefound field to 1 or -1 to tell me that the paragraph number does NOT exist in the file?
    Thank you in advance.

    Thank you for the quick reply. However, I am NOT trying suppress the message.  I am tying to handle the message.  In other words, I want the message to appear when required BUT I want to be able to try and CAPTURE the fact so that I can specify the page as being non-existent (such as entering a -1 for the page).  Is there any way in Adobe or VBA coding in Excel to recognize that the message is displaying but not stopping it, just recognizing that it is appearing and handle it?  Thanks in advance.

  • Acrobat 4.0 possible patch to handle newer .pdf files?

    I am currently at a small printing company that uses a Heidelberg Prosetter and interconnected software programs for platemaking in our pre-press department. We currently have an outdated Heidelberg meta dimension system that I was told will only handle Acrobat version 4.0 files. I get errors when a newer .pdf version is sent to me from my customers. So far I have found work arounds such as saving the .pdf file down to a compatible file, but am running out of options, and the newest version 9.0 files are really giving me a headache. Saving the file down doesn't seem to help. Is there a possible patch I can find to allow version 4.0 to handle the newest files? Heidelberg has told me that if we were to upgrade to a newer version of Acrobat we would need to upgrade the rest of our software (PitStop Server, Meta Dimension, SignaStation) since they all work together to burn plates and that would cost us upwards of $25,000. Being a small company we can not afford this and the owners have basically told me to work with what I have. Can anyone help me?

    I still keep having some issues with transparent objects and drop shadows with a spot colors. I just spoke to our Heidelberg rep and he mentioned that they even had to update their software to handle the 9.0, and are now recommending that customers upgrade to the newest version of Meta Dimension (which is very costly I might Ad!). I think I am just stuck between a rock and a hard place, and will be there as long as I work here! Not only do I have issues with the transparent objects, I am sometimes getting a flat out will not open error message in EnFocus PittStop which is our pre-flight software. I am going to have to post this on the EnFocus forums and hope that someone might be able to solve that for me. Thanks for the input. I kind of thought that a patch like that was out of the question! There is just no help for poor people like me!

  • Unable to make Acrobat X the default handler/opener of PDF files on a Windows 8 laptop with Acrobat Reader also installed.

    I have a user with a Windows 8 Sony Vaio laptop with Microsoft Office 2013 Professional, Acrobat X Standard, and Acrobat Reader installed. Another program on his system requires Acrobat Reader so we cannot just remove that and keep it off the system. Regardless of what he does to set the default program to open PDF files with, when he opens a PDF file it always opens it in Acrobat Reader and not Acrobat itself. We have re-associated it and set the default program handling repeatedly and have also tried complete uninstall and reinstall of both Acrobat and Acrobat Reader which had no effect on this. At this point I am of the opinion that this is a bug and the file association is being overridden somewhere in the registry besides the file association entries. Any help is appreciated.

    The only supported way to set the default handler (besides the Wizard and cmd line properties) is via the UI at Edit > Preferences > General > Default PDF Handler. The installer has to be invoked and many registry entries get touched during the switching process.
    You should also verify your dot versions of the product support Windows 8: Overview — Acrobat and Adobe Reader Release Notes.
    Finally, while you Acrobat 10 should work with Reader 11, try reverting to Reader 10 (that should be your last resort).
    Ben

  • XMP Standard - Is there a tool for non-professionals to handle PDF files for free?

    I'd like to start organising my various files and I wonder if I could include PDF files into the process (it seems easier with graphics), possibly also some video or audio files in the future. I hope there's a tool, not onle for IT specialists to handle it and some clear video/document tutorial to assist.
    Waiting  for your advice !
    Darek, Poland

    As I mentioned on the other thread, the forms need to be
    flattened. CFPDF cannot flatten LiveCycle forms, only Acrobat
    Forms. The suggested solution was to use LiveCycle ES
    http://www.adobeforums.com/webx/.3c052176

  • PDF Preview Handler will not open 1 file

    Hi,
    I have Office 2013 and Acrobat XI, the PDF Handler works fine on all my files except one.
    Through our online ordering, I get a confirmation email with E-Order.pdf with every confirmation, worked for a while and now gives me the
    "This file cannot be previewed because of an error with the following previewer
    PDF Preview Handler
    To open this file in its own program, double-click it."
    If I go to any other PDF attachment it works fine.
    Thanks
    Gregg

    Hi Anubha,
    Yes I do have the latest version of Acrobat 11, 11.0.10.
    I have tried turning the PDF Handler off and back on, that didn’t fix it.
    I also installed Reader 11 and that did not fix it.
    If there is something else I can try please let me know.
    Thanks
    Gregg Hynda
    General Manager
    P     07 5576 5757
    F     07 5576 6990
    M   0412 644819
    E      <mailto:[email protected]> [email protected]

  • How to open PDF file generated by some ashx handler using POST parameters in Internet Explorer for W

    I need to print content of pdf file by JavaScript.
    To do this used HTML like this:
    <OBJECT id = "Pdf" data = 'http://someurl.com/getpdf.ashx' name="Pdf2" WIDTH="300" HEIGHT="300"></OBJECT>
    <a onclick="document.Pdf.PrintWithDialog() ;">Print file</a>
    But to get pdf file I must POST few parameters to handler http://someurl.com/getpdf.ashx. How I can do it?

    Hi Hi Sven,
    Could you please tell me the type of report you were trying execute? Is it ERP or BW? And ALV or non-ALV?
    We are supporting PDF report output type only for BW reports and for ERP non-AVL reports. For other types PDF format is not supported.
    If you configure PDF for other report types then you will get report output in PDF file in SharePoint server, but you will face above error message while opening the file.
    Regards,
    Binson

  • How to open report.pdf file? getting error message file cannot be previewed pdf preview handler

    how can I open a report.pdf file that shows error: file cannot be previewed because of an error w/ pdf preview handler

    Hi pfmercerville,
    If you are running the 64-bit version of Windows 7 (or Vista), you will find that your PDF files do not preview in Windows Explorer as they do in the 32-bit versions. Instead, all you see is a message stating that This file can’t be previewed. To enable this functionality on your 64-bit operating system, follow these steps.
    1. Click the Orb (Start Button).
    2. Go to the Search programs and files textbox and input regedit.
    3. Select regedit.exe from the results.
    4. When the UAC prompt appears, click the Yes button.
    5. In the left pane of the Registry Editor, go to (and select):&#8232;
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{DC6EFB56-9CFA-464D-8880-44885D7DC193}
    6. In the right pane, locate AppID.
    7. Change AppID value to {534A1E02-D58F-44f0-B58B-36CBED287C7C}.
    8. Restart your computer for the change to take affect.
    Regards,
    Rave

  • File handles don't close when the pdf is closed?

    Using Acrobat X on Windows 7 Pro in a networked environment.
    Once I open a PDF file in Acrobat, as long as I have acrobat running, (even after I have closed the file and moved on) I cannot change/move/rename the file. Since I spend a lot of time reviewing information that comes to me in a pdf, I usually have multiple PDFs open, so to shut them all, rename/move/delete one file and then go back to find all the the items I was working with is an enormous hassle. I had this problem before, than it disappeared, now it has returned. Is this normal Acrobat behavior?  Or do I need to dig into network settings?

    I tried what you suggested Matt G. and it didn't work. I googled my problem and it seems that other users of 10.0 have had the same problem. Basically, when a PDF is opened it "steals" the scroll function. The scroll function then only works in the PDF doc and nowhere else. As soon as the PDF is closed, the scroll function works again.
    I have tried updating my plugins, have updated Adobe Reader, and tried your suggestion. I also tried a couple of other options suggested in the link you sent. No help.
    Any other ideas? Thank you.

  • Arrgh! Is anybody else having problems with the Adobe Acrobat open source approach to handling PDF files? I am getting as many as three crashes and full reboot per day and the delays are terribly frustrating.

    Do I have a registry problem?
    Every time I open a PDF file my local Adobe Acrobat (6.0) installation opens AND the file displays in Firefox (v. 4.0.1). When I close the PDF file it tells me other PDF files are open and asks if I'm sure I want to close Acrobat.
    The process is messy and somewhere, before too long there is a memory error that causes the whole system to crash.
    Is anybody else having this problem? Does anybody have any idea how to fix the conflict?

    Do I have a registry problem?
    Every time I open a PDF file my local Adobe Acrobat (6.0) installation opens AND the file displays in Firefox (v. 4.0.1). When I close the PDF file it tells me other PDF files are open and asks if I'm sure I want to close Acrobat.
    The process is messy and somewhere, before too long there is a memory error that causes the whole system to crash.
    Is anybody else having this problem? Does anybody have any idea how to fix the conflict?

  • File handling like PDF's, eps etc

    I deleted Preview, then Color Sync utility tried to open PDF..when I'm in InDesign CS and I want to edit orginal, it should 100% always open in Photoshop.
    But, it looks for Preview sometimes (no matter what I do with the litte "Get info/Open With" trick.
    I want Tiger to never know Preview existed and most certainly, not to open a low-level viewer.
    I remember the old days of setting via the systems settings, not application, what apps to use to open different files.
    Is there a similar way in Tiger?

    If going the Get Info->Open With route doesn't do the trick, then I suspect that the LaunchServices database is fouled up. See http://www.thexlab.com/faqs/resetlaunchservices.html and
    http://www.macosxhints.com/article.php?story=20031215144430486 for details on how to rebuild it.
    BTW, IMHO, deleting Apple-supplied apps is bad juju. Updates will probably get hosed when the installer can't find the pieces that are included. You should reinstall it (extract it from the install disk using Pacifist), run the latest COMBO update, and then use the Get Info method to use something else for PDF files.

  • Firefox keeps changing the way it handles PDF files. Why?

    I have been pulling my hair out over this one. When I click on a PDF file, I'm asked for a "save" location. When I set the application option to preview PDF files, it does so until I re-start Firefox, at which point it reverts back to "Save File." It's driving me mad.
    == This happened ==
    Every time Firefox opened
    == Unknown

    Bump. I have the same problem; in fact, it is also described here: [http://support.mozilla.com/en-US/questions/826904 http://support.mozilla.com/en-US/questions/826904]
    WHY does this happen? Still no answer from Mozilla. Very disappointing...

  • PDF Portfolio only showing the first 32 pdf files in it.

    Hello,
    I have a pdf portfolio document which contains about 150 pdf-files. Opening this portfolio in Adobe Reader X on my iMac shows me perfectly all 150 files, no problems at all.
    After installing Adobe Reader on my new iPad (3rd generation), synchronising the portfolio with iTunes, then for some strange reason, I can only see the 32 first files in that same portfolio.
    I synced the portfolio to my iPhone4 and got the same problem there viewing it with Adobe Reader X (only 32 first files listed).
    Later on today, I installed GoodReader on the iPad : opening the same portfolio gives me a splash-screen, saying that I have to "use Adobe Reader X for best experience"... I think this is
    the build-in first page where some discussion in forums handle about... However after using "Manage Files" in GoodReader and selecting the portfolio, it extracted a folder containing all 150 files... nice job!!
    However, I would like to use Adobe Reader X for this (for multiple reasons...).
    Anybody experiencing same problem ? Some hints ? All ideas appreciated.
    Kind regards
    Filip

    ?

Maybe you are looking for

  • For-each skip rows based on test null condition

    I thought this would be simple, but I can't seem to find a satisfactory answer in the XML Publisher manuals. For various reasons, I have a pre formatted Oracle Report in EBS which doesn't group the XML tags as I want them. I have some groupings with

  • How can I add custom captions to a waveform graph scale?

    I have an application that displays one or more signals in a WvfmGraph.  The X Axis is set by a hardware encoder giving signals vs. distance (measured length).  I would like to change the caption of the XScale according to the values of one of the si

  • File Adapter Writting and Reading strategy

    Hi All, When i am trying to write data to file, it was opened by another person and it gave error in the receiver communication channel saying like source is using by another application. Which is well and good But in case of Sender channel while wri

  • Help!!! remote client throws NullPointerException

    Hi, I get the following exception when trying to use a remote client on Win2k with weblogic 6.0 evaluation copy, trying to connect to a Unix machine running Weblogic 5.1 sp9. I am simply trying to run te statefulSession bean client example. please he

  • Mouse click in JTable

    Hi All, I want to force mouse click when right clicking on a JTable. I mean when the right click is done in the mouse, the left click should be forced. I have a JTable with some values in it. I want to select the particular column in the table when r