Getting PDF files

Hi!
I am writting a code to get pdf files in order to concat it lately. I am using this piece of code:
  public void get(String strURL, String strFileName){
    try {
      URL url = new URL(strURL);
      URLConnection urlconn;
      urlconn = url.openConnection();
      BufferedReader buff = new BufferedReader(new InputStreamReader(urlconn.getInputStream()));
      File file = new File(strFileName);
      BufferedWriter bw = new BufferedWriter(new FileWriter(file));
      System.out.println("writing the file");
      int value;
      char [] charBuff = new char [10];
      while ((value = buff.read(charBuff)) != -1){
        bw.write(charBuff);
      buff.close();
      bw.close();
    } catch (MalformedURLException ex) {
      System.out.println("URL malformed");
      ex.printStackTrace();
    } catch (FileNotFoundException ex) {
      System.out.println("File not found");
      ex.printStackTrace();
    } catch (IOException ex) {
      System.out.println("I/O Error");
      ex.printStackTrace();
  }Unfortunately, this does not seem to work. The get file is unreadeable. If I compare to files, one get by firefox or any other browser, and the other downloaded with my application, some characters seems to be not exactly he same.
Any ideas? Thanks in advance!

Thanks a lot for the tip!
Honestly, I copy this code from a Sun Java Tutorial for handling URL connections, I did not think about binary files at all. I thought it was an encoding issue. Sorry I the question was silly.

Similar Messages

  • How to get PDF file that has been transformed into docx into my filing system so I can work on it???

    How can I get the PDF file that was transformed into a docx file into my filing system to be able to work on it and translate it as the customer requested?

    THanks for your reply.
    Well what happens is I bought the program. It gives you a button to click,
    you log in and then a box opens up asking you to select the file, I go into
    my filing system (in Windows explorer) select the file, and the program
    converts it into docx, my choice.  I can read it there and when I try to
    copy and paste it into my file where the PDF version is saved, it behaves
    like an "image", and I can't save it.... or it saves likes something you
    save on the internet, so you have to go into internet every time you want
    to see it.    I have also pressed any amount of buttons to see if it will
    give me the option to save it any other way, and have found nothing.  What
    I would need is a file in docx.format that I can edit.  People send me
    things in PDF and sometimes I can just copy it off the PDF file and save it
    in WOrd, then I can translate it for them. But sometimes the PDF file
    doesnt allow me to copy the text.  If it is in image form, I cannot work on
    it.  It means printing it, so I can copy type it into Word... and for that
    I certainly wouldnt need to buy a program.  Its just double the work and
    ends up that the job takes twice as long.!
    Sorry  if I am a bit dumb with informatics.  But I simply could not find
    any way whatever to  copy the PDF file that was transformed into Word, in a
    format that would enable me to edit it.
    Kindest regards,
    Margery
    2013/12/2 Test Screen Name <[email protected]>
        Re: How to get PDF file that has been transformed into docx into my
    filing system so I can work on it???
    created by Test Screen Name<http://forums.adobe.com/people/TestScreenName>in *Adobe
    ExportPDF* - View the full discussion<http://forums.adobe.com/message/5890871#5890871

  • Installed reader many times.  Still cannot get pdf files.  Cannot print statements or bills.  Help!

    Installed reader software numerous times.  Still cannot get pdf files to open so I can print bank statements and bills.  Help!

    When you say you cannot print, do you see any error? Please use Print button from Reader toolbar instead of Safari > Print.
    What is your Safari version? You can find it from  Safari > About Safari
    Can you please verify Safari > Help > Installed Plugins : Do you see Adobe Acrobat NPAPI Plug-in, Version 11.0.06?
    Thank You

  • Anyone know how to get pdf files to print on Mac

    anyone know how to get pdf files to print on  a Mac. When i bring pdf file up and press print a box comes up saying cannot print. When i press that one another comes up saying no pages selected. Everything up to date, rebooted, checked to make sure plugins are there and up to date.

    Might not be exactly what you want and I haven't had time to fully investigate this but take a look at http://www.hanynet.com/waterroof/

  • Hii,i m new to adobe flex but want a basic start...where to get pdf files to study

    hii,i m new to adobe flex but want a basic start...where to get pdf files to study

    A good place to start is with the Flex in a Week online course that you can do at your own pace.  You can download the Day Project Files and get PDFs of all the transcripts for the videos and all the starter and solution files.
    There is also more infomation here as well:  http://www.adobe.com/devnet/flex.html
    It is not in a PDF format but you can print it out or just work at your own pace online to get started with Flex.

  • Why do I get pdf files with an underscore  in the extension ( ._pdf)

    Why do I get pdf files with an underscore  in the extension ( ._pdf)  and how do I  open them when they are email attachemnts, becuase it wont let me rename it or save it as any other version.

    Not sure. What email are you using? Gmail (or web based email) by chance?
    Definitely not a Reader issue if you can see the underscore in your email.
    You can try saving it as is then try renaming it using Windows Explorer to see if that works.

  • How can i get pdf files from my ipad to my pc?

    Please help im so lost, i need to get a pdf file from my ipad to my pc but it doesnt work with workspaces. I really need it for uni.

    If you are running the Adobe Reader app on your iPad you can upload your pdf to .crobat.com and then download it to your laptop
    On your iPad open your PDF in the Adobe Reader app
    Select the save icon in the top toolbar - looks like a doc with a wrench)
    Select 'Save to Acrobat.com'
    Select the 'Get Started' button
    Enter you Adobe ID and password
    Your file should be saved up to Acrobat.com
    Go to your PC
    Launch your internet browser
    Open https://files.acrobat.com/
    Log into Acrobat.com with the same Adobe ID as you used on your iPad
    Your file should be available
    Select the file and select the Download icon
    You can download the file to your hard drive
    Another option is
    Go to you PC
    Launch Adobe Reader
    Select File > Open
    From the Open Dialog select the dropdown arrow beside 'Open from online Account' - select Acrobat.com
    You will be prompted to enter your Adobe ID and Password
    You should then see your PDF in the listings
    Select to open
    Once open you can save to your desktop
    hope this helps
    Susan

  • How can I get pdf files to minimize up into the upper left corner of my Windows 8.1 Pro screen?

    Hi -
    I have both a laptop and a desktop running Windows 8.1 Pro. When I open a pdf file on my laptop, and I click on the adobe reader icon in my taskbar at the bottom of the screen, the pdf doc is minimized up into the left hand corner of the screen where I can then right mouse click and insert the pdf file left or right of any other document I pull up onto my screen, i.e. I can create side by side windows of the two documents. But if I try the same thing on my desktop and then click on the adobe reader icon, it will not minimize up into the left hand corner. Does anyone now I can get my desktop to do what my laptop is doing since they are running the same OS?
    Thank you!

    This can be a bug on Mac.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How do I get PDF files to *automatically* save as the file name provided by the source?

    When I download a PDF file in Firefox, the file name changes from whatever name source used (e.g, important-report.pdf) to a miscellaneous group of characters (e.g., X2ba5zt.pdf). I often want to save the file using the 'source' name. I realize that can so do by changing the file name, but I would like to know if there is a way to set the default so that the source file name is used.

    I am not seeing that behaviour. If I right-click a link to a .pdf file, I get the file saved with the original filename.
    Maybe one of the settings in about:config controls that?
    pdfjs.previousHandler.preferredAction is a setting that has a value of 4 with my setup. I have no idea what that means, and I could not find any explanation anywhere. You could try using different numbers for that value and see if any make any difference. Why has nobody bothered to explain that setting anywhere?

  • How to get pdf file from sap presentation server using java connector

    Hi Friends,
    with the below code i am able to get po details in pdf in presentation server.
    DATA : w_url TYPE string
           VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
    CALL FUNCTION 'ECP_PDF_DISPLAY'
            EXPORTING
              purchase_order       = i_ponum
           IMPORTING
      PDF_BYTECOUNT        =
             pdf                  = file  " data in Xsting format
    *Converting Xstring to binary_tab
          CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
            EXPORTING
              buffer                = file
      APPEND_TO_TABLE       = ' '
    IMPORTING
      OUTPUT_LENGTH         =
            TABLES
              binary_tab            = it_bin " data in binary format
    **Downloading into PDF file
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
      BIN_FILESIZE                    =
              filename                        = w_url
              filetype                        = 'BIN'
             TABLES
              data_tab                        = it_bin
    when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
    init:
    deps-jar:
    compile-single:
    run-single:
    com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
            at PdfGen.<init>(PdfGen.java:35)
            at PdfGen.main(PdfGen.java:78)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)
    i debugged too, problem with <b>gui_download......</b>
    I am very glad to all with your suggestions!!
    Regards,
    Madhu..!!

    Hi
    You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
    How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
    Max
    Edited by: max bianchi on Oct 13, 2011 10:27 AM

  • Getting PDF files doesn't work on Windows 7?

    Hi,
       I had a working installation of Adobe Output Central v5.5 on a Windows 2000 machine. I then tried to move it to Windows 7 because we want to change the hardare.
    I set up all programs to run as Windows 2000 under windows 7 (this is something you can decide with the standard functionalities of Windows 7) and all works, BUT, if I try to generate a PDF document I get the famous error [Invalid printer type (98)].
    I use the -asppdf command line parameter to force PDF output and the PDF presentment target is compiled into the MDF file.
    98 is the number that you can read in the "Printer Type" parameter in the pdf.ics file.
    If I comment out that line in the ICS file, the PDF file is produced, but it's corrupted, so it's not readable with any PDF reader.
    Any idea?
    Manyt thanks in advance.

    Have you tested an external mouse as I already suggested?
    You can try to install Value Added Package for another Portege series notebook. Just search a little bit on the Toshiba website.
    In worst case you have to restore factory settings (preinstalled OS). There should the mouse working properly.

  • Getting pdf files into ibooks?

    I have the latest version of itunes and the latest version of ibooks on my iphone when I connect my iPhone to the macbook pro There is a books tab in itunes but there is no way to add pdf files or documents to it I tried dragging and dropping and nothing happens and there is no buttons for adding documents can someone inform me how to get pdfs on there?

    nevermind figured it out myself there is a books section on the left side of itunes and thats how you add them in there

  • How to get .pdf files from iMac to laptop?

    This is a question on behalf of a friend of mine who has a desktop iMac (OS 9.2 -- about 5 years old) as well as a MacBook laptop (Tiger 10.4 -- brand new) .
    He has received multiple .pdf files via email (Comcast) and has those saved to his desktop iMac. He wants to get them onto his laptop.
    How does he do this?
    Thanks in advance.

    I think the easiest, most elegant way to to do this would be to have him simply, email the pdf's to himself.
    He could then retrieve the email while using the laptop. He could even go online to his comcast webmail account and download the pdfs he has attached to an email - He can download them to the desktop of any computer in the world.
    I think the ethernet cable and creating a target disk steps are a bit of overkill for such a simple task, not to mention, if you don't have those cables, running out to make such a purcha$e in this instance is not justified and a waste of time (IMHO) - But proof that with a Mac you can accomplish one task in several ways.

  • Cannot get pdf file to print actual size

    I recently had to reinstall my printer and now when printing PDF files I cannot get the page to print in full size.  This is necessary because I am printing a pattern and the size has to be accurate.  I am not even given the option anymore to be able to do this.  I did have the option before the reinstall.  BTW the reinstall is because the computer crashed and I had to take back to factory settings.  I appreciate any help given.  Thanks.

    pamw523
    Welcome back to the HP Community Forum.
    This may be helpful:
    Manage Print Output with Print Preview
    Assuming you have installed the Full Feature Software for the printer
    and
    Assuming that you have at least a recent version of Adobe Reader or Adobe software installed so you can download and open PDF files,
    then
    it may only be that the PDF print setup needs to be adjusted for the file prior to printing
    See pages 5 and 6
    You can also check
       Print PDFs
    ===========================================================
    Click the Kudos Thumbs-Up to say Thank You!
    And...Click Accept as Solution when my Answer provides a Fix or Workaround!
    I am pleased to provide assistance on behalf of HP. I do not work for HP. 
    Kind Regards,
    Dragon-Fur

  • Cannot get PDF files to load on the iPad Mini from iTunes!

    Cannot get PDF to load on the iPad Mini through iTunes (latest version).   I could easily do this on the iPod Touch.   So what is missing?

    I solved my problem.  It turns out the default in iTunes is NO Sync for books or podcasts.  Once I turned that on I had success.   That wording should be included in the explanation on how to transfer PDF files to the iPad.

Maybe you are looking for

  • Need help trying to create a ActiveX registered event

    I am trying to create a register event for an ActiveX component. The problem I am having is creating the callback vi. When I right click on the VI ref and create the callback vi it is created with the user parameter as a variant. I would like this to

  • Behaviour of AXIS with Spring and Java, in response to bad webservice call

    This is a stretch, but I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to provide webservices for access via

  • How do I add music to a PDF presentation

    I am making a presentation of a yearbook for our school reunion and wanted to add the school song, fight song to the presentaion. Is there an easy way to do this?

  • How to make treetable transparent

    hi, Does anyone have idea how to make the treetable transparent so that the background image can be shown? Pls provide sample code if possible,thanks!

  • Korg MicroKontrol

    So far I haven't found too useful or helpful information in my search. Some people seem to have working native mode and others don't. After trial and errors I've got it partially working... I got this keyboard in the hope I can have an easier access