PDF + IText Question

I have the contents of a pdf document as a byte[]. I send the byte[] to another webserver and I want to re-create a new pdf from this byte[] on this other server. How can I do this using Itext?

// write ByteArrayOutputStream to the ServletOutputStream
                 response.setContentType("application/pdf");
                 response.setContentLength(baos.size());                      response.setHeader("Cache-Control","no-cache");
                 response.setHeader("Pragma","no-cache");
                 response.setDateHeader ("Expires", 0);
                 ServletOutputStream out = response.getOutputStream();
                 baos.writeTo(out);
//here baos is a byte array that contains pdf output.Regards
-John-

Similar Messages

  • Converting from PDF directly to Java Objects/XML (and PDF format questions)

    Hi,
    I posted this originally in the Acrobat Windows forums but was told I might have more luck here, so here goes:
    I am desperately trying to find a tool (preferably open source but commercial is fine also) that will sit on top of a PDF and allow me to query it's text for content and formatting (I don't care about images). I have found some tools that get me part of the way there, but nothing that seems to provide an end-to-end solution but is quite lightweight. My main question is WHY are there so many tools that go from PDF to RTF, and many tools that go from RTF to XML, but NONE that I can find that go PDF to XML.
    To clarify, by formatting I simply mean whether a line/block of text is bold/italic, and its font size. I am not concerned with exact position on the page. The background is that I will be searching PDFs and assigning importance to whether text is a heading/bodytext etc. We already have a search tool in place so implementing a pure PDF search engine is not an option. I need a lightweight tool that simply allows me to either make calls directly to the PDF OR converts to XML which I can parse.
    Some tools I have tried:
    1) PDFBox (Java Library) - Allows the extraction of text content easily, but doesn't seem to have good support for formatting.
    2) JPedal (Java Library) - Allows extraction of text content easily, and supports formatting IF XML structured data is in the PDF (not the case for my data).
    3)  Nitro PDF (Tool) + RTF to XML (script) - This works quite nicely and shows that PDF to XML is possible, but why do I have to use 2 tools? Also, these are not libraries I can integrate into my app.
    4) iText (Java Library) - Seems great at creating PDFs but poor at extracting content.
    I don't really expect someone to give me a perfect solution (although that would be nice!).
    Instead, what I'd like to know is WHY tools support PDF to RTF/Word/whatever retaining formatting, and other tools support RTF to XML with the formatting information retained. What is it about PDF and RTF/Word that makes it feasible to convert that way, but not to XML. Also, as I found in 3) above, it is perfectly feasible to end up as XML from PDF, so why do no tools support this reliably!
    Many thanks for any advice from PDF gurus.

    XML doesn't mean anything - it's just a generic concept for structuring
    information.  You need a specific GRAMMAR of XML to mean anything.  So what
    grammar would you use?  Something standard?  Make up your own?
    However, there are a number of commercial and open source products that can
    convert PDF to various XML grammars - SVG, ABW, and various custom grammars.
    But the other thing you need to understand is that most PDF files do not
    have any structure associated with them (as you saw when using JPEDAL).  As
    such, any concepts of paragraphs/sections/tables/etc. Are WILD GUESSES by
    the software in question.

  • PhotoShop CS2 and PDF Presets question.

    Hello,
    I have installed the recent free release of Adobe Photoshop CS2 on my Win 8.1 PC.
    I am creating the artwork for a CD Cover, by using a CYMK template from CD-Baby.
    They require that the finished artwork be submitted to them in PDF format, using the [PDF/X-4:2008] preset.
    I found that Photoshop CS2 didn't come with this preset, but after searching the web, I came across this forum whereby a user posted a link to a "JobOptions" archive file at...
         http://dl.dropbox.com/u/16243351/joboptions.rar
    ... I downloaded this RAR file and found that there was a file inside called "x4;2008.joboptions"
    I installed this preset by the 'EDIT/Adobe PDF Presets/' route, and it seemed to successfully install the preset.
    (No errors at least).
    Now when I go to save my finished project as PDF, I am given the choice of...
    * [PDF/X-1a:2001]
    * [PDF/X-3:2002]
    * x4;2008
    (this is the exact description of each preset).
    My only question is, do you think the desired [PDF/X-4:2008] was correctly installed?,
    I'm not sure since the naming format is not exactly the same as the first 2 presets descriptions.
    Thank you.

    thanks for your reply  Mylenium.
    is it possible that this user preset might not exactly conform to the desired preset I'm after?
    is there any way I can get a genuine copy of the factory preset [PDF/X-4:2008]?
    thanks.

  • How to return a pdf (iText) file using Portlet?

    Dear all,
    I want to know how to return a pdf file using iText API via Portlet.
    I can manage to return a pdf file through a standalone servlet, but I don't have idea of how to generate a pdf file via Portlet.
    Can anyone help me?
    Thanks
    George (HK)
    Welcome to my blog at www.xanga.com/georgelkh

    Hello,
    that is easy. In your driver program, please check the inputs of the job/ generator function modules.
    You provide GETPDF = 'X' attribute what will make the FM not to print the form or display the preview but to return the binary stream of the PDF data (type FPCONTENT) what is a RAW or something. Next look for the PDF output parameter to get the returned binary data and send it as you wish through JCo.
    Regards Otto
    p.s.: Note there is Adobe forms forum under NetWeaver, you can find me and the others doing Adobe every day

  • PDF displays question mark font

    I'm trying to study for an exam, but am having trouble viewing certain PDF files. It displays a box-enclosed question mark font. Up till a few days ago, I could read them just fine, but then I ran Onyx and since then I get the weird font. I've tried opening in Preview, Adobe reader, Skim, and in my browsers and they all do this. Can someone please help me out? Thanks

    Hello belgremoo, and a warm welcome to the forums!
    Sounds like a munged Font or Font Cache.
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, it will try to repair your Disk Directory while the spinning radian is happening, so let it go. Reboot when all done, it clears Font Caches as well.
    Start with Font Book in Applications, Validate Fonts first, if that doesn't fix it then move all your new fonts to a different set & leave only these in the Main set...
    http://support.apple.com/kb/HT1538

  • Creating a Fillable/Savable PDF: simple question?

    Hello-
    I'm new to Acrobat and LiveCycle Designer.  I have just created my first form with fillable fields in LifeCycle to send to my company's clients for them to fill out, save the form with their responses in the fields for their own records, and then attach the completed PDF form to an email to send back to us with their responses in the fields.  I cannot figure out how to do this.  The closest I can come to this is putting a "Submit by Email" button in the form which generates and sends an XML document which is not what I'm looking for; I need the actual filled PDF form sent back to me from the client.
    I'm sure this is an easy task, but I have been unsuccessful with figuring this out on my own or finding a post in the forum which clearly answers my questions.
    I'm using Acrobat 9 Pro and LiveCycle Designer ES version 8
    Can you help me?  I'm lost.
    Thanks-
    Michael

    Srini-
    Thank you for your response, but I'm afraid I'm somewhat confused.
    I opened your attached Send CC Email.pdf file in LiveCycle Designer to take a detailed look at it and found the setting you referenced under the Submit tab:
    I understand this location and setting the Submit As field to "PDF".
    I then opened your form itself to see if/how the submission would work:
    This is where my confusion starts.  When I click on the Send Email button in your example document, I only get an error message:
    What was supposed to happen?
    If you reference my original post, I'm looking for a way to create a PDF the user may 1.) Save electronically with the PDF document's fields filled for their own records and 2.) send the completed document back to my company with their responses.
    I don't understand how your suggested solution is supposed to work to allow me to accomplish these two objectives.
    What am I missing?
    Thank you again-
    Michael

  • Animated Text In Interactive PDF, also question about SWF distribution

    Hello Forum.......first post, so hi to everyone
    I have created a indesign cs5 document that has some animated text flying in from the left upon mouse clicking, if i export it to a SWF it works fine but if i export it to an interactive PDF the text is already in place. Is it possible to have animated text in an interactive pdf?
    Another question I have is regarding swf files, i need to create some presentations for our sales guys to run on their lap tops while out at clients, when i export it you get the resources file and the swf file....rather than just dropping these into a folder on their laptop is there a slicker way to package it in some kind of projector file.
    It would also be nice if in the future I could put the presentation onto a CD and have it auto launch the presentation.
    If anyone could give me some basic pointers it would be appreciated.
    Thanks
    James

    Hi, George.
    Thank you for your help and reply.
    It seems that the Lightbox effect may be complicated to achieve with Acrobat in a relatively simple way. Is it possible to accomplish a similar effect using InDesign CS5 and Acrobat Pro 9 ? I would like to click on certain elements of my PDF document (images or text) and have a window of a pre-specified size (approximately 800 wide x 600 high) open in the center of the screen.
    Can I do this in InDesign ?
    One other things I noticed is the ability to embed html code in Acrobat. Can this be used to accomplish this effect ? Can a window be opened in the center of the screen triggered by a button in a PDF file so that this window functions as a browser and displays another document downloaded from web address (file located on a server) ?
    Thank you again,
    Joe.

  • Pdf Security question

    I know I cannot prevent anyone from saving a pdf file. So, this is what I wish to do. I would like to be able to give access to a pdf file that can be opened from my server and the pdf file will open without asking for a password. That is, the pdf file obtains a permission file from my server. If someone saved the pdf file, it wouldn't matter to me whether they stored it on their computer or my server as I can still control access by a time stamped access file.
    So, then everyone plays nice with the pdf file, they won't have any problem. If they remove the server access portion, then they would be required to provide a password to access the file. As I understand the security issues, documents that require a password to decrypt are more difficult to remove security from than those that allow access, like limit printing, etc. If that were true, then it would also encourage readers to just play nice with my files.
    Re: The Adobe Document Center, you may not "Market any goods or services for any business purpose (including advertising and making offers to buy or sell goods or services), unless specifically allowed to do so by Adobe." Why would I worry about access to something I was giving away?
    Suggestions or am I barking up the wrong tree?

    Sounds like you are describing a DRM plug-in for Acrobat. These can be
    produced using the SDK, and even for Reader, though there is a five
    figure license fee if you want to do it for Reader.
    Adobe Document Centre seems to be an implementation of Adobe's
    LiveCycle Policy Server. While Policy Server is a heavyweight server
    product used mainly by corporates, this is a copy of Policy Server run
    on Adobe's servers and administered by them. This is clearly going to
    have a different licensing model and may suit smaller enterprises
    better.
    Could you give a little more context about the second question. Is
    this a question about yourself (why would *I* worry), or is it
    actually asking why Adobe would worry?
    Aandi Inston

  • Parsing PDF, iText

    Hi all, I just realized that u cant parse a pdf with iText. Like to insert a string of text at 'marker'. Anyone got a better tool or idea?
    Thanks...Peter

    Even if just identifing the x,y coords of a 'marker' would help, because I can drop text at a hardcoded location.

  • PDF with Question marks : Critical

    We are facing one issue in the production .
    In our application we are generating PDF using FOP. Now this functionality is working fine on the staging server but same is giving problem on the production server.
    On the staging/ UAT server PDF is generated fine, but same PDF is generated with question marks (?) in the production.
    I am not able to add the pdf files over here. One is generated on the staging server and other is generated on the staging one is containing Question marks.
    I will show the relevant parts where there are differences:
    ABC, Inc. (Buyer) on UAT but ABC? (Buyer)
    It seems to me that the spaces are being converted to ? marks...
    Any suggestions on this are welcome

    A simple solution would be to add "fake" crop and registration marks in full inking to your design, then convert to PDF. (I did that for a CD cover I made on a laptop with "just" Photoshop.
    When you purchase Acrobat, you get an acrobat print driver, so I guess you can print with the crop and registration marks in the Ps output settings...

  • PDF cropping question

    I posted this question in the Illustrator Forum too, but thought it might be worthwile to see if anyone here had any ideas. I have a few hundred PDF files that I created in Illustrator. The Illustrator document size on all of these is 8.5 x 11, but on each file I created a smaller crop area to the artwork. These files crop to the crop area on their image previews and when I open them in Acrobat, but for some reason, they are coming in at the full document size for the programmers that are working with them. I need a way to either automatically reset the Illustrator document size to the crop area, or possibly to process it in Acrobat and remove the document size. I don't want to run it through Photoshop, because we want to keep the vector data, and our tests worked better with Illustrator PDFs then Photoshop.

    The problem is not the files, Acrobat, nor Illustrator. The crop used is a non-destructive crop. The entire pdf exists. Your programmers must learn how to determine the crop box and use that information.

  • Printing and Signing PDF Security Questions

    Hi,
    I noticed one of the PDF security features for Acrobat 8.0 is to set the printing permissions between "None", "150 DPI", and "High Resolution". However, when I print between two PDF's with 150 DPI and max resolution, I honestly can barely notice the difference between the two (the 150 DPI is "slightly" worst, i.e. letters are slightly more jaggedly). I was wondering is this normal, as I was hoping the lower setting would make the printout hard to read, not just a "quick-print" (I used a Laser Printer with 1200 DPI). I don't mean to make a big deal out of it, but I personally do not think this a very useful feature from a security standpoint.
    Secondly, I'm having trouble creating signable PDF's. I basically want the file to only allow a user to sign, and nothing else, so I set the "Changes allowed" to just "filling in forms and signing existing signature fields". But doesn't seem to work, because instead I have to set it to allow "any except extracting page". Only then can I sign the PDF, but then this also allows it to be changed (which I don't want). Is there something wrong with what I'm doing? Any help is appreciated!

    It's a very common question, and as Michael says there's not a lot you can do. Even doing the imposition yourself is unlikely to help, as most commercial raster image processors (RIPs - the software which turns your document with its fonts, graphics etc into the pattern of dots needed to physically generate the image on the printing drum) need unencrypted files.
    If the print shop has an ad-hoc workflow which supports encryption (such as printing direct from Acrobat in the way desktop users do), there are plugins for Acrobat to handle the page imposition; but it's not something native to the application and the printer will have to give you very precise directions as to what layout to create. Many print shops won't entertain that idea unless there's an overriding commercial reason, as it's too much hassle for them to deal with errors in the client plates. Worth asking, but I doubt they'll agree to it.
    Given the need to send unsecured files to an external contractor for printing, your "protection" is in the form of the contract, not digital encryption. The former can be settled in court if they break the terms, the latter can be bypassed in ten seconds and you'll probably never know. If the files are truly too sensitive to send to anyone, it's time to get yourself a laser printer - these days the machines many local print shops rely on are in essence a color photocopier, and you can rent them for about the same price.

  • Basic PDF/SSL Question

    Okay, I know this is a basic question, and I'm not sure if this is really where I should be posting it, but maybe someone out there has experience with this.
    I have a PDF form sitting on a secure server.  I have it set up to email the completed PDF back to our company when the user clicks the SUBMIT buttton.  Whether or not the PDF is secure coming back to us would be dependent on the email server the user uses - not that the form sits in a secure area on our server or that the PDF is security settings are set, correct?
    Any input appreciated.
    Thanks
    Q

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Acrobat sdk and pdf library questions.

    hello everyone. i have some questions.
    is acrobat sdk can develop software without acrobat?  like pdf library sdk
    pdf library sdk and acrobat sdk can use same project?
    thank you

    This question belongs here: http://forums.adobe.com/community/acrobat/acrobat_sdk

  • PDF Security Questions

    Hi All,
    I have several questions about the PDF security:
    1. Does anybody know any good pdf security web seminars? Please give me the link.
    2. I sell my journals (pdf version) to my clients but I want to prevent them from copying my journals to the others (FYI, I have adobe Pro). I would like to restrict my clients to open the pdf only in their computers not the others. How can I use adobe to do that? Would you please suggest any security options that I can use?
    Thank you very much for your information in advance. It is greatly appreciated.
    Best regards,
    Eddy

    Adobe security is mostly honored only by other Adobe products. It doesn't matter what steps you take in Acrobat, they can be bypassed in less than a minute by free, easy to find applications.
    If this is really a concern, you wil want to look in to a Digital Rights Management solution. Adobe DOES have a solution available but I won't speak for the quality of it since I have never used it.

Maybe you are looking for

  • Verizon has failed me and I will no longer be a customer.

    I wanted to order a prepaid phone. So I did. I couldn't place an order with a separate shipping address than billing address. This is bad for me, because my credit card is linked to my home address, buty I live at university right now. I chatted onli

  • SmartForms - draw line in template

    Hi!   I am new to SF, so have a question on drawing line in a template. I use template as the data is only printed out once and is static. I have many columns in my template and I would like to draw lines on the columns so that it is tidy & looks nic

  • Biztalk WCF Cutom Adapter

     Actually my WCF Custom adapter is pointing to my local machine SQL now ineed to point to my Dev environment the same send Port like my local machines URL is mssql://HDUPEDEVBIZ\Biztalk/AfmsDevice? i have to change now to mssql://HDUPEDEVSQLDB02\INST

  • The "mac book" pro turns off after performing the internet recovery

    we had the macbook pro and we put in a new hard drive and when we press the power button it turns on and has a flashing file qith a question mark on it and we did the internet recovery thing but after its done it just turns off again. please help

  • Can't get wi fi to work on  my computer; does on another

    Back at home and the ipad2 won't work on my newer computer. However, it was trying to connect previously but wanted a password?? Which I had not idea, what it was. Just received this ipad2 yesterday. Works fine at another location on an older compute