Invalid pdf document

I get an error screen saying "INVALID PDF DOCUMENT" when I can see that it isn't.

What OS?
What browser?
What Reader version?

Similar Messages

  • Problem in printing pdf document with java code

    Hi All
    I want to print a pdf document with java code i have used PDFRenderer.jar to compile my code.
    Code:
    File f = new File("C:/Documents and Settings/123/Desktop/1241422767.pdf");
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel();
    ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
    PDFFile pdfFile = new PDFFile(bb); // Create PDF Print Page
    PDFPrintPage pages = new PDFPrintPage(pdfFile);
    // Create Print Job
    PrinterJob pjob = PrinterJob.getPrinterJob();
    PageFormat pf = PrinterJob.getPrinterJob().defaultPage();
    pjob.setJobName(f.getName());
    Book book = new Book();
    book.append(pages, pf, pdfFile.getNumPages());
    pjob.setPageable(book);
    // System.out.println(pjob.getPrintService());
    // Send print job to default printer
    pjob.print();
    but when i am running my program i am getting error
    Exception in thread "main" java.awt.print.PrinterException: Invalid name of PrintService.
    Please anybody, knows the solution for this error?
    Thanks In Advance
    Indira

    It seems that either there is no default printer setup or you have too many printers or no printer setup at all. Try running the following code. It should print the list of available print services.
    import java.awt.print.*;
    import javax.print.*;
    public class PrintServiceNames{
         public static void main(String args[]) throws Exception {
              PrintService[] printServices = PrinterJob.lookupPrintServices();
              int i;
              for (i = 0; i < printServices.length; i++) {
                   System.out.println("P: " + printServices);
    }From the list pick one of the print service names and set it explicitly like "printerJob.setPrintService(printServices);" and then try running the program.

  • Printing a PDF document using Java 1.4 Printing API

    Hi,
    When I tried to print a PDF document using JAVA 1.4 Printing API, I got the following exception.
    Exception in thread "main" sun.print.PrintJobFlavorException: invalid flavor
    at sun.print.Win32PrintJob.print(Win32PrintJob.java:290)
    at Printing.main(Printing.java:40)
    I am able to print the same PDF document using Acrobat reader.
    Is PDF format not supported in JAVA 1.4 printing API? or is something wrong in my code?
    here is the sample JAVA program that I was using
    import javax.print.*;
    import javax.print.attribute.*;
    import java.io.*;
    public class Printing {
    public static void main(String args[]) throws Exception {
    String filename = args[0];
    PrintRequestAttributeSet pras =
    new HashPrintRequestAttributeSet();
    DocFlavor flavor = DocFlavor.INPUT_STREAM.PDF;
    PrintService defaultService =
    PrintServiceLookup.lookupDefaultPrintService();
    DocPrintJob job = defaultService.createPrintJob();
    FileInputStream fis = new FileInputStream(filename);
    DocAttributeSet das = new HashDocAttributeSet();
    Doc doc = new SimpleDoc(fis, flavor, das);
    job.print(doc, pras);
    Thread.sleep(10000);
    System.exit(0);
    Thank you
    Sumana

    Here's a pure Java solution (that works!):
    http://www.mycgiserver.com/~zhouwu/pdf/readme.html
    The caveats are:
    - prints only to the default printer
    - requires a properties file located in the home directory
    my workaround for the last:
         * Print a PDF file to the default printer (might consume lots of memory!).
         * <p>
         * <b>Required:</b>
         * <ul>
         * <li>a file "acrobat.properties" needs to be in the working directory. The content is:
    <table align="center" bgcolor="#E0E0E0" border=1 cellpadding="10" cellspacing="0"><tr><td><pre style="margin-top:0; margin-bottom:0">
    #com.adobe.acrobat.Viewer Properties
    #Wed Oct 29 20:34:05 PST 2003
    com.adobe.acrobat.AcceptedLicAgreement=true
    com.adobe.acrobat.Fax_Fine_Mode=true
    com.adobe.acrobat.Find\:FindAll=false
    com.adobe.acrobat.Find\:FindBackwards=false
    com.adobe.acrobat.Find\:FindWholeWord=false
    com.adobe.acrobat.Find\:MatchCase=false
    com.adobe.acrobat.Open_Dialog_Directory=C\:\\temp\\
    com.adobe.acrobat.Open_Dialog_File=itext.pdf
    com.adobe.acrobat.Print_Method_Known=true
    com.adobe.acrobat.Shrink_To_Fit=false
    com.adobe.acrobat.SitePreferencesURL=file\://localhost/C\:/pdf/acrobat-site.properties
    com.adobe.acrobat.Use_Print_Server=false
    com.adobe.acrobat.util.fontDirectories=C\:\\Winnt\\Fonts
    com.adobe.acrobat.util.fontIgnoreExtensions=.fon;.pfm;.ini;.lst;.txt;.doc;.ttmap;.z;.enc;.dir;.afm;.f3b;.pfa;.spd;.ps;.bepf;.map;.alias;.scale;.all;.upr
    </pre></td></tr></table>
         * <li>The JAR files PDFPrinter.jar, acrobat.jar and MRJToolkitStubs.zip in the CLASSPATH.
         * </ul>
         * <p>
         * Note: the file "acrobat.properties" is expected to be in the user's home directory. As this is not always feasible,
         * the system property "user.home" is mapped to "user.dir" for the time of execution.
         * @param fileName Name of PDF file to print.
         * @throws Exception on error.
         * @see <a href="http://www.mycgiserver.com/~zhouwu/pdf/readme.html">PDF Server (Silent) Printing</a>
        public void printPDF(String fileName) throws Exception {
            String oldHome = System.getProperty("user.home");
            System.setProperty("user.home", System.getProperty("user.dir"));
            PDFPrinter vi = new PDFPrinter();
            vi.activate();
            vi.setDocumentInputStream(new FileInputStream(fileName));
            vi.printAll();
            System.setProperty("user.home", oldHome);
        }//printPDF()I just need the following additional files in my CLASSPATH: PDFPrinter.jar, acrobat.jar and MRJToolkitStubs.zip. Despite the note at the site above that "printing quality is not very good", i can't agree: the print quality is quite good. Not perfect, but acceptable for most uses.
    (Tested on Windows 2000 SP4, J2SE 1.4.2_03, hp laserjet 2300dn)

  • Issue while Signing and Encrypting the PDF Document.

    Hello,
    I am developing one component in VC++(MFC) which signs and encrypts the pdf documents.
    When i sign and encrypt pdf document using my component, I am getting following error while opening the document in Adobe Acrobat
    Error during signature verification
    Unexpected byte range values defining scope of signed data.
    Details: The signature byte range is invalid
    But if i open that document in binary mode and calculate the byte range its looking correct.
    The Process for signing and encrypting the PDF document is as follows :
    1)Prepare the PDF document for signing (Add Annotation objects,n0,n2
    layers,create blank signature field,new xref section etc.)
    2)Encrypt the whole document(Password based encryption).
    3)Put the ByteRange values.
    4)Write the signature in blank signature field.
    If i just perform encryption(128 bit RC4 Algorithm) on the pdf document its working fine.Only after adding the signature objects i am getting above error.I think it means something is wrong in signature related objects,but i am not able to recognize the exact problem.
    So what can be the issue?
    Please Help
    Thanks in Advance
    Priyanka

    I am sending the Sample Files
    blank.pdf file is a original file
    http://www.2shared.com/file/4677649/3f341d92/blank.html
    step 1: I am adding Signing object(without data in Contents<> key) in
    blank.pdf file.
    Output File is Prepared-blank.pdf
    http://www.2shared.com/file/4677648/48332d04/Prepared-blank.html
    step 2: Sending Prepared-blank.pdf file for encryption.
    Output File is SignednEncrypted-blank.pdf which is Encrypted and Signed.
    http://www.2shared.com/file/4677647/d88c3095/SignednEncrypted-blank.html
    Password for opening SignednEncrypted-blank.pdf is : "a".
    Please help.
    Thanks.

  • SICF customer service in order to retrieve PDF document from archive (ICC)

    All,
    I am currently trying to set up a scenario to integrate SAP-VIM (vendor invoice management) with the ICC (invoice capture center; from opentext). In this process the ICC application loads data from SAP together with a scanned invoice (in PDF format) stored in our archive.
    Since we are not using any sap-certified archive solution I had to build the data retrieval via custom programming. But when the ICC component is trying to upload the data I am getting following error: "Error while trying to get invoice image(s) and recognition results from SAP: Unable to load datapool. Data at the root level is invalid. Line 1, position 1." Did someone have experience with this kind of set-up of with the error?
    Steps done:
    - create a Z-service in SICF with own class (based on copy of CL_HTTP_EXT_CSIF)
    - inside this class programmed to data retrieval of the PDF document of the archive (in Base64 format or Binary format)
    - filling the header fields of the response via
    l_mimetype = 'application/pdf'.
      call method l_entity->set_header_field:
        exporting name = 'Content-Type'      value = l_mimetype,
        exporting name = 'Content-Length'  value = l_size_s, 
        exporting name = 'pVersion'        value = l_pversion,
      call method l_entity->set_data
        EXPORTING
          data   = l_data
          offset = '0'
          length = l_length.
    l_data = binary data of PDF-file
    Best Regards,
    Kris

    831692 wrote:
    Hello everyone,
    I'm using BI Publisher 11g to generate PDF documents. I had implemented a servlet that uses HTTP POST/GET to simulate the behaviour of BIP console since ScheduleReport Service is not implemented in this version. The problem is about the output of the final documents when i'm not using the bursting option. From my experience, the documents are not saved in any temporary folder in the filesystem. Looking at DEV_BIPLATFORM schema and analysing XMLP_* tables, i'm assuming that the generated document data is the BLOB DATA field in the XMLP_SCHED_DATA table...this is right?
    Next, in java, i'm using the BLOB field to output his binary content to a PDF file but, when i try to open the file, it gives an error: "document may be damaged"...
    Any suggestions here would be appreciated...
    Thanks in Advance
    Regards,
    NP1. Yes, it contains the output document.
    2. If the output type is PDF then the BLOB contains a zip file which contains the PDF document.
    So first unzip it before rendering
    Cheers
    Jorge
    p.s. If your question is answered then please grant the points and close the thread

  • [SOLVED] Okular Can not open pdf Document

    Whenever I try to open a pdf document by Okular it says "Could not open /directory/filename.pdf". Terminal shows following error:
    okular(25136)/okular (app) Okular::DocumentPrivate::loadGeneratorLibrary: Invalid plugin factory for "okularGenerator_poppler"!
    I tried to update poppler using "sudo pacman -S poppler" and it re-installation completed successfully. But it didn't help at all.
    Last edited by abhisek (2013-09-08 04:27:00)

    Actually pacman -S <package> is safe (although pacman may fail to find the package). It is passing the -y flag without the -u flag which causes the trouble.
    In any case, you definitely did pacman -Syu?
    Does this problem occur for all pdfs or only a certain one or certain ones?
    Does
    pacman -Qk kdegraphics-okular
    show any problems?
    EDIT: Also, what does
    locate okularGenerator_poppler.so
    give?
    Last edited by cfr (2013-09-07 20:01:28)

  • Importing one Pdf document into another.

    I am trying to import one Pdf-document into another using a Reference XObject. I am looking at thePDF- specification, and I thought I was doing things the right way, but its not working. The PDF-specification doesen't have an example of how to do this, only an explanation.
    Below is the PDF-file I am testing with (if anyone can be bothered looking at it   ). The file embeds another pdf-file, and is supposed to show a part of the embedded file at a certain position.
    Again, if anyone can be bothered looking at my PDF and see if they can see what I am doing wrong here I would appreciate it.
    (There is nothing wrong with the embedded file itself...)
    PDF-file embedding another PDF-file and using a Reference XObject to display the embedded file:
    %PDF-1.5
    1 0 obj
    <<
    /Type /XObject
    /Subtype /Form
    /BBox [0 0 100 100]
    /Ref <<
    /F (4fa27162e72547a00771606.pdf)
    /Page 1
    >>
    >>
    endobj
    2 0 obj
    <<
    /Type /Filespec
    /F (4fa27162e72547a00771606.pdf)
    /EF <</F 3 0 R>>
    >>
    endobj
    3 0 obj
    <<
    /Type /EmbeddedFile
    /Length 854
    >>
    stream
    %PDF-1.5
    1 0 obj
    <<
    /Length 334
    >>
    stream
    q
    1 0 0 1 128.10769621539 70.591821183642 cm
    1 0 0 1 0 0 cm
    1 0 0 1 0 0 cm
    1 0 0 1 0 0 cm
    1 0 0 1 -128.10769621539 -70.591821183642 cm
    /DeviceCMYK CS
    1 1 1 1 SCN
    /DeviceCMYK cs
    0 0.89 0.89 0.05 scn
    0.2743205486411 w
    2.743205486411 M
    0 J
    0 j
    -1.9202438404877 -2.6517653035306 260.05588011176 146.48717297435 re
    h
    B
    Q
    endstream
    endobj
    2 0 obj
    <<
    /Type /Page
    /Parent 3 0 R
    /Resources <<
    /Font <<>>
    /XObject <<>>
    >>
    /MediaBox [0 0 255.11811023622 141.73228346457]
    /Contents [1 0 R]
    >>
    endobj
    3 0 obj
    <<
    /Type /Pages
    /Kids [2 0 R]
    /Count 1
    >>
    4 0 obj
    <<
    /Type /Catalog
    /Pages 3 0 R
    >>
    endobj
    xref
    0 5
    0000000000 65535 f
    0000000010 00000 n
    0000000401 00000 n
    0000000568 00000 n
    0000000624 00000 n
    trailer
    <<
    /Size 5
    /Root 4 0 R
    >>
    startxref
    679
    %%EOF
    endstream
    endobj
    4 0 obj
    <<
    /Length 322
    >>
    stream
    q
    1 0 0 1 93.268986537973 71.826263652527 cm
    1 0 0 1 0 0 cm
    1 0 0 1 0 0 cm
    1 0 0 1 0 0 cm
    1 0 0 1 -93.268986537973 -71.826263652527 cm
    55.961391922784 45.628651257302 74.615189230378 52.39522479045 re
    W n
    1 0 0 1 55.961391922784 42.062484124968 cm
    74.615189230378 0 0 55.961391922784 0 0 cm
    /XobjectPDF1 Do
    Q
    endstream
    endobj
    5 0 obj
    <<
    /Type /Page
    /Parent 6 0 R
    /Resources <<
    /Font <<>>
    /XObject << /XobjectPDF1 1 0 R >>
    >>
    /MediaBox [0 0 255.11811023622 141.73228346457]
    /Contents [4 0 R]
    >>
    endobj
    6 0 obj
    <<
    /Type /Pages
    /Kids [5 0 R]
    /Count 1
    >>
    7 0 obj
    <<
    /Type /Catalog
    /Pages 6 0 R
    >>
    endobj
    xref
    0 8
    0000000000 65535 f
    0000000010 00000 n
    0000000144 00000 n
    0000000238 00000 n
    0000001172 00000 n
    0000001551 00000 n
    0000001738 00000 n
    0000001794 00000 n
    trailer
    <<
    /Size 8
    /Root 7 0 R
    >>
    startxref
    1849
    %%EOF

    PDF is a binary format. The most important piece in a PDF file is the cross
    reference table. It contains byte offsets to the different objects in a
    file. If you insert just one space (which in a true ASCII file will not
    change much), you are making all byte offsets after the insertion point
    invalid. They now all point to something different than the start of an
    object.
    Because there is no standard about how line endings are encoded in text
    files, every time may add (or subtract) a byte - depending on what computer
    system and what editor you use to convert your PDF to fake-ASCII, and then
    again what I use to try to convert it back to PDF. If you are using a
    Windows system and I'm using a Mac, the cross reference table gets
    corrupted. And that's even before the web server does it's magic and
    potentially adds data.
    If you want somebody to look at your file.
    Have you looked at the post I linked to? The settings in Acrobat are
    important. You need to enable Reference XObjects, AND you have to declare
    the directory where your target file is stored as trusted.
    From what I can see in your PDF code, you are doing a whole bunch of cm
    operations. You may want to consolidate all those into one operation. I
    have not done a detailed analysis, but you could potentially shift your
    data off the page. Keep it simple and see if that makes a difference.
    Karl Heinz Kremer
    PDF Acrobatics Without a Net
    [email protected]
    http://www.khkonsulting.com

  • What is involved in removing an image from a PDF document and inserting a new one?

    Our form producing process is very typical:
    (1) Start with a TIFF image, create a fresh PDF document.
    (2) By adding items such as links and interactive fields, convert the read-only document into an interactive form.
    Step (2) may take a lot of work, but fortunately when modifications are needed, it is always possible to edit the individual items. No need to redo the whole form from scratch.
    There are some cases, however, in which we have invested a substantial amount of work in Step (2), but we need to modify the underlying image, removing it and replacing it with a new one. We obviously don't want to destroy all the work done in (2).
    I envision the procedure as taking a rug from underneath a person and putting a new one.
    What is involved in doing that? Can that be done at the JavaScript level? Are there commercial packages that can do that? Is the Acrobart SDK required?
    -Ramon

    Document->Replace Pages
    Been in Acrobat since at least version 5.

  • A pdf document created in cs5 cannot be printed in duplex on a pc without cs5 or adobe reader pro

    Hi!
    there is a "normal" cs5 created pdf document.
    the installed cs5  pc -> i can print in duplex on every printer, without cs5 installed duplex printing not possible.
    I am searching for a solution to print the pdf document in duplex mode on every printer, but only with the latest freeware version adobe xi 11.0.3.
    (If i install adobe cs4 on a pc it is possible to print the document in duplex mode on a hp3525 printer, but duplex is not possible on a ricoh printer for example mpc5502.)
    I cant upload the file, because its bigger than 2 mb. (5mb)
    Is there anybody out there for help.
    If you need the file, i´ll send 2 u.
    thx

    Yep, it definitely is a complicated workflow... But I'm not really sure of any other way to get from the 34" wide pattern to the home-sewing version which is split into pages and has alignment marks and whatnot. I'm very much an amateur that has figured it out as I went
    I went through the page in the photo pretty thoroughly with the layer panel and I couldn't find any mystery lines... But I did find something interesting; when I click on any of the pattern lines, it shows the whole line of the pattern piece, which extends well past the edge of the artboard. So when I'm printing the poster-sized PDF to 7.5x10 pages, it's keeping all the anchor points of a line even if only a small piece of that is on the actual page.
    Does this help? I've included the page in the photo as well http://www.putlocker.com/file/DADB4759DBB860D8
    Thanks again to everyone!
    Also, should I be keeping all the files I'm editing as .ai files and then only exporting to PDF for the very final product? I was doing that at first, but then using .pdf for the whole process didn't seem to make any difference.

  • Error message 'not a valid PDF document'

    Hi folks,
    my Z10 has trouble opening some PDF documents sent as email attachment. When I try to open them the error message appears:
    Important message
    The document cannot be opened because it is not a valid PDF document
    There is no BES10 Service involved in my environment. Mails are synced with with active sync.
    OS Version: 10.2.0.429
    Any suggestion appreciated.
    Best regards,
    RAUMPATROUILLE

    Stuffit is the only app I know of which can decompress its own format. Your Windows clients must use the free Expander to open them. Otherwise, use OS X's built in zip compression and they'll be able to open the files without the need of third party software. Right click on any item, or group of items and choose, "Compress xxx Items" (how it will read if more than one item is chosen).

  • Error while exporting to PDF document in OBIEE 11g

    Hi
    In OBIEE 11g we are facing an issue regarding exporting a few reports to pdf. It is resulting in following error: "Error generating PDF document".
    The reports are placed on a dashboard which has a prompt too. However, when we remove the prompts, the export is working fine.
    We will really appreciate any help in this regard.
    Thanks.

    Hi,
    Looks like this is a sort of known bug with PDF creator in 11g. Try implementing the below solution:
    To configure the Javahost service, edit the Javahost service configuration parameters in the
    instanceconfig.xml file. The parameters are
    identified by their relative path starting from the /WebConfig/ServerInstance node
    For example:
    <JavaHost>
    <PDF>
    <InputStreamLimitInKB>50000</InputStreamLimitInKB>
    </PDF>
    </JavaHost>
    After changes restart Siebel Analytics Java Host and Siebel Analytics Web services
    If it doesn't work try to create same report in xml publisher as presentations services in obiee has limited capacities in printing out reports.
    Refer to this thread for related useful information: Error in creating a PDF
    Hope it helps.
    Thanks,
    -Amith.

  • When I open a pdf document from my dropbox to view it, the document shows up blank, even though it is filled out. This also happened with pdf documents that have been e-mailed to me.

    When I open a pdf document from my dropbox to view it, the document appears blank, even though I know the information is actually there. This also has happened with pdf documents that have been e-mailed to me, then opened to view and they are blank?? Why are they showing up blank?

    When I open emails with PDFs I click on the attachment (doing this all on my iPad) it gives me the option to "open in iBooks", I accept then after that the document is sucked into my iPad but I can't do anything with the PDF after that.  Where is the actual file on my iPad? Why can't I email or send these PDFs to my cloud (Dropbox)?
    It's like once they go into iBooks they're stuck forever.

  • When I sign in to the Adobe Reader XI (which is the only option that I have to open a pdf document, I will sign in to the Adobe ID sign-in page. After I do this, the "Convert To" box goes "gray" and I am unable to convert the document I have selected.  It

    When I sign in to the Adobe Reader XI (which is the only option that I have to open a pdf document, I will sign in to the Adobe ID sign-in page. After I do this, the "Convert To" box goes "gray" and I am unable to convert the document I have selected.  It was working great for the first week that I used it, but now it doesn't give me the converting option.  I am very frustrated as I have done nothing to change anything, and I was thinking this was so great...now I am just pulling out my hair and do not have the option of calling anyone since no phone numbers are listed. I am VERY busy and do not have time to sit and wait over a half an hour to "chat", which I tried to do yesterday.  All I want to do is very simply, convert pdfs to Word.  I have paid for this and am not getting any help. I am not very savvy when it comes to Adobe this program and Adobe that program...I feel I am being scammed as I do not get simple answers for something that appeared was going to be simple. You can't even call customer service to talk to someone live to help walk you through. 

    Hello Kathie,
    Sorry for the inconvenience that has caused to you.
    Please let me know if you have tried converting any other PDF to word with Reader.
    Alos, please sign up at "https://cloud.acrobat.com/" using your Adobe ID credentials. Click on 'ExportPDF' tab and upload the PDF that you want to convert to Word.
    Let me know if this converts fine.
    Hope to hear from you.
    regards,
    Anubha

  • Specifying pdf document's name in browser - content-disposition problem

    Hello ,
    I want to open a PDF document in browser, which needs to have a specified filename when user tries to save it.
    My web app sends an "application/pdf" document back to the browser.
    I use the Content-Disposition HTTP header to instruct the browser to open the document inline, i.e. using the appropriate plugin, which is Adobe PDF in this case. When the user clicks Save As..., the document filename needs to be the one specified by the same HTTP header. Here is the code:
    response.setContentType("application/pdf");
    String contentDisposition = "inline; filename=\"filename.pdf\"";
    response.setHeader ("Content-Disposition", contentDisposition);
    response.setHeader ("Content-Length",new Long(file.length()).toString());Unfortunately this does not work for me. Document opens fine, but I can't get it to have the name I specified. The plugin uses the default name, which is the full URL of the document. I tried several combinations of HTTP headers, but neither worked. I tried putting an additional GET request parameter at the end of the URL, like ...&filename=filename.pdf , but that didn't work either.
    I tried Adobe 7.0 and 8.1.2.
    Any suggestions ?
    Thanks a lot!

    Thank you very much for your answer.
    Needless to say I tried opening the document in IE, FF and Chrome, and neither worked.
    I had a look at the code at your web site, and saw that you were serving files for direct download: Content-Dispositoin:attachment... .
    This works fine for me too, and the filename is recognized correctly in that case. The problem is, I want to display the PDF inline...
    My server is not configured for URL rewriting, and I would be probably quite some problem to make this app work with it, so the /filename.pdf is not an option for me.
    Edited by: matavulj on Sep 25, 2008 7:21 AM

  • A PDF document with information about activation for CS6 software

    Here's a PDF document with information about activation for CS6 software.
    I found it very useful for understanding how the system worked for activation of perpetual licenses, both in cases where the computer is and isn't connected to the Internet.

    Ann, with some browsers, the PDF document will download in the background rather than appear in a browser window.

Maybe you are looking for