Converting a text file into a PDF? PLZ help

hi all,
i need some help !
i have a text file which i'm reading in to array of bytes and then i insert the bytes into an output stream.
now i want to send this file to the client browser where it would open Adobe acrobat reader and display the contents .
I'm using a servlet to acheive this and i've set the response.setContent("application/pdf")
the obvious problem is Acrobat reader is not able to open the contents.
is there a work around for this?
i would be grateful if anyone could come up with a solution

Hello.
http://www.lowagie.com/iText/

Similar Messages

  • Setting Font for converting multiple text files into PDF using VB 6.0

    Dear All,
    Am converting multiple text files into PDF using VB6.0. Currently, am unable to control the font face and size for the generated files. Below is the procedure am using for each file;
    Public Sub proc_convert_to_PDF(srcFilename As String, destFilename As String)
    Dim p_AcroApp As CAcroApp
    Dim p_VDoc As CAcroAVDoc
    Dim p_DDoc As CAcroPDDoc
    Dim IsOk As Boolean
    Set p_AcroApp = CreateObject("AcroExch.App")
    Set p_VDoc = CreateObject("AcroExch.AVDoc")
    Call p_VDoc.Open(srcFilename, "")
    Set p_VDoc = p_AcroApp.GetActiveDoc
    If p_VDoc.IsValid Then
    Set p_DDoc = p_VDoc.GetPDDoc
    ' Fill in pdf properties.
    p_DDoc.SetInfo "Title", Format(Date, "dd-mm-yyy")
    p_DDoc.SetInfo "Subject", srcFilename
    If p_DDoc.Save(1 Or 4 Or 32, destFilename) <> True Then
    MsgBox "Failed to save " & srcFilename
    End If
    p_DDoc.Close
    End If
    'Close the PDF
    p_VDoc.Close True
    p_AcroApp.Exit
    'Clear Variables
    Set p_DDoc = Nothing
    Set p_VDoc = Nothing
    Set p_AcroApp = Nothing
    End Sub
    What I need;
    1) to be able to set the font face of the destination file ( destFilename)
    2) to be able to set the font size of the destination file ( destFilename)
    Am using Adobe Acrobat 7.0 Type Library
    Kindly Help.
    Thanks in advance

    We didn't say it doesn't work. We said it isn't supported.
    There are a number of other ways to make a PDF. The one which would
    give the most control is if your application directly printed to GDI,
    controlling the font directly. This could print to Adobe PDF.
    You could look for an application that gives control of font for
    printing.
    You could use a text-to-PostScript system and distill the result. You
    could even look for a non-Adobe text-to-PDF.
    Working in the unsupported and dangerous world you chose, the font
    size for text conversion is set (and this is very bad design from
    Adobe) in the settings for Create PDF > From Web Page. There is no API
    to this.
    Aandi Inston

  • I am having issues converting my word file into a pdf.

    I am having issues converting my word file into a pdf. When I attempt the conversion the pdf download has text boxes overlapping each other. The word file does not have overlapping text boxes. I believe it is the margins of my word file but I am not certain. How can I accurately edit my word file then convert it into a pdf without the overlapping issue occuring?

    Hi,
    Please send me your Word file so that I can look into the issue using below:
    https://adobeformscentral.com/?f=qJiclooYWGGNFtWfj8g3wg
    thank you.
    Hisami

  • How do I convert an ASP file into a PDF?

    How do I convert an ASP file into a PDF?

    None of the free Adobe Reader products (Adobe Reader Touch, Adobe Reader for iOS/Android, Adobe Reader XI for desktop) provide the support for converting ASP to PDF.
    Acrobat XI Pro and Standard (which are not free) can convert an ASP page into PDF.
    Please note that Acrobat XI Pro, Standard, and Reader XI are not compatible with the Windows RT operating system.

  • How do I convert an Excel file into a pdf?

    how do I convert an Excel file into a pdf?

    Hi tomduffey,
    You can either use Create pdf service or Adobe Acrobat software for the purpose.
    Please refer -
    Using Create PDF service : https://www.acrobat.com/createpdf/en_GB/convert-excel-to-pdf-converter.html
    Using Adobe Acrobat : http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe- acrobat-xi-create-pdf-files-tutorial-ue.pdf

  • How do I convert an InDesign file into a PDF file, it won't let me do it when I 'Save As'. Help??

    I need help with converting an InDesign file into a PDF file.
    I've tried looking into the program and seeing if i can do it, but it is not giving me the option.
    I need to be able to do this for work purposes.
    Please help.

    Try Exporting. There are also number of useful Export PDF presets that come with design.
    What do you want to do with the PDF?

  • How do I convert a .pub file into a PDF, 2 page spread without the dotted line down the center?  I can select 2 page view and cover page in 2 page view, but the dotted line shows up.  Thank you!!

    How do I convert a .pub file into a PDF, 2 page spread without the dotted line down the center?  I can select 2 page view and cover page in 2 page view, but the dotted line shows up.  Thank you!!

    Hi skt102711,
    I would like to inform you that acrobat doesn't support .epub to .pdf format conversion. Please browse this Link for more information : Supported file formats | Acrobat, Reader
    Regards,
    Rahul

  • How to convert the TEXT file into an XML using plsql code

    Hi all ,
    I need to convert an TEXT file into an XML file how can i do it
    Below is my sample TEXT file .
    TDETL00000000020000000000000120131021115854ST2225SKU77598059          0023-000000010000
    I want the above to be converted into the below format
    <?xml version="1.0" encoding="UTF-8"?>
    <txt2xml>
      <!-- Processor splits text into lines -->
      <processor type="RegexDelimited">
      <regex>\n</regex>
            <!--
            This is used to specify that a message should be created per line in
            the incoming file;
            NOTE: this was designed to work with all the processors, however it
            only works correctly with 'RegexDelimited' processors (check the
            enclosing top processor type)
             -->
             <maxIterationsPerMsg>1</maxIterationsPerMsg>
      <!-- For lines beginning with FHEAD (File Header) -->
      <processor type="RegexMatch">
      <element>FHEAD</element>
      <regex>^FHEAD(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,Type,Date</element>
      <regex>^(\d{10})(\w{4})(\d{14})$</regex>
      </processor>
      </processor>
      <!-- For lines beginning with TDETL (Transaction Details) -->
      <processor type="RegexMatch">
      <element>TDETL</element>
      <regex>^TDETL(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,TransControlNumber,TransDate,LocationType,Location,ItemType,Item,UPCSupplement,InventoryStatus,AdjustReason,AdjustSign,AdjustQty</element>
      <regex>^(\d{10})(\d{14})(\d{14})(\w{2})(\d{4})(\w{3})([\w ]{13})([\w ]{5})(\d{2})(\d{2})([+-]{1})(\d{12})$</regex>
      </processor>
      </processor>
      <!-- For lines beginning with FTAIL (File Tail) -->
      <processor type="RegexMatch">
      <element>FTAIL</element>
      <regex>^FTAIL(.*)</regex>
      <processor type="RegexMatch">
      <element>OriginalLine</element>
      <regex>(.*)</regex>
      <consumeMatchedChars>false</consumeMatchedChars>
      </processor>
      <processor type="RegexMatch">
      <element>LineSeq,TransCount</element>
      <regex>^(\d{10})(\d{6})$</regex>
      </processor>
      </processor>
      </processor>
    </txt2xml>
    Thanks

    Sorry, that doesn't make much sense.
    The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
    Are you a user of this utility?

  • Converting multiple msft files into one pdf

    HELP - i am using adobe acrobat 9 pro for macs (Mac OS X 10.6.3). when we had a pc, we were able to convert multiple files (microsoft office) to a single pdf at once without first converting them all to pdf. when I attempt this using the same technique, the images for all documents other than pdf files are greyed out and it seems that word/office documents are not a supported format for the conversion of multiple files (not listed in drop down menu) into one pdf.
    I would greatly appreciate help with this. we are business users who are new to macs. we need to do a lot of this and are getting so frustrated. Thanks in advance!

    Hi mephisto11757,
    You can convert the following file types to PDF with the Adobe CreatePDF service:
    Adobe Creative Suite® file formats Examples include: .psd, .ai, .indd
    Microsoft Word (2000, XP, 2003, 2007, 2010, & 2011) .doc, .docx
    Microsoft Excel (2000, XP, 2003, 2007, 2010, & 2011) .xls, .xlsx
    Microsoft PowerPoint (2000, XP, 2003, 2007, 2010, & 2011) .ppt, .pptx
    Microsoft Publisher (2000, XP, 2003, 2007, 2010, & 2011) .pub
    Text Files .txt
    Rich Text Format .rtf
    Adobe PostScript .ps
    OpenOffice Format .odt
    Star Office .sxw, .sxi, .sxc, .sxd, .stw
    Corel WordPerfect .wpd
    Image file formats .gif, .png, .jpg, .bmp, .tiff
    Regards,
    Florence

  • How can I convert a word file into a pdf and then upload to a web site?

    I need to convert a word document into a pdf and then upload it to a web site so people can read it from my
    site. How can I do this? Can anyone please help? I'm only a newbie. Thanking you in anticipation.

    Hi there,
    There's actually an easy streamlined way to do this using Acrobat.com. Here are the steps:
    1. Log in to Acrobat.com with your Adobe ID.
    2. On the left, you'll see a navigation menu that includes the item "Import and Edit". Click that.
    3. Choose the .doc (Word) file you want to convert and upload it to Buzzword.
    4. After making sure that it looks the way you want it to, go to the top menu (still in Buzzword now, not the organizer where all your files live) and click the document menu. There will be an option to "Export" - choose that.
    5. When prompted to select filetype, choose "Adobe PDF" and press OK.
    6. It'll save to your desktop, so now you have to get it into your acrobat.com organizer. To do that, close the Buzzword document by clicking the little "x" in the upper right corner, under the Sign Out button. This'll get you back to your organizer, where you can choose "Import" from the left nav menu again. This time choose your new PDF file.
    7. Select the  file icon in the organizer and click the Share button. Or, select Share  from the file context menu.
    8. Select Allow Anyone With A  Link To Share This Document to set the document to open access, and then  click Copy Embed Code. The necessary HTML code to embed the preview is  copied onto the clipboard.
    9. Open the HTML file and paste  the code into the file. The Flash previewer can display any file type  that you can convert to PDF.
    Hope this helps! Good luck, and let us know how it works out.
    Rebecca

  • How do i convert a word file into a pdf file?

    How do I convert a word document into a .pdf file?

    Hi wertheca,
    If you have Acrobat, (full version), you can convert a file to PDF by choosing File > Create > PDF from File. Then you choose your Word document, and click Open to convert the file to PDF.
    If you don't have Acrobat, you can use an Acrobat online services subscription to convert almost any format of file to a PDF with just a click or two. For more information, see Acrobat Plus, PDF Pack, Export PDF & More | Acrobat Document Solutions
    I hope this helps.
    Best,
    Sara

  • Converting a text file into a String

    I need to convert a text file (in whatever format, in my case it would be xml and xsl files) in a String.
    I made this methods:
    public static String createStringFromFile(File f) {
            StringBuffer buf = new StringBuffer();
            try {
                FileInputStream fInp = new FileInputStream(f);
                byte[] byteArray = new byte[fInp.available()];
                int bLetti = fInp.read(byteArray);  
                if (bLetti == fInp.available()) {
                    for (int i=0; i<fInp.available(); i++)
                        buf.append(Byte.toString(byteArray));
    else
    throw (new IOException("Errore nella lettura del file"));
    fInp.close();
    } catch (Exception e) {
    ErrorManager.getError(e);
    return (buf.toString());
    public static String createStringFromFile(String fileName) {
    StringBuffer buf = new StringBuffer();
    try {
    FileInputStream fInp = new FileInputStream(fileName);
    byte[] byteArray = new byte[fInp.available()];
    int bLetti = fInp.read(byteArray);
    if (bLetti == fInp.available()) {
    for (int i=0; i<fInp.available(); i++)
    buf.append(Byte.toString(byteArray[i]));
    else
    throw (new IOException("Errore nella lettura del file"));
    fInp.close();
    } catch (Exception e) {
    ErrorManager.getError(e);
    return (buf.toString());
    There are no compilation or runtime errors, but the result string is empty. Not null, empty. What should I do? :)

    Do you really want to use bytes and so on when java does it all for you?
    Here's how I did it, hope it's useful.
    public String getFileAsString(String fileName){
         StringBuffer buffer = new StringBuffer();
         try{
         BufferedReader bRead = new BufferedReader(new FileReader(new File(fileName)));
         String str = "";
         while( (str = bRead.readLine()) != null ){
              buffer.append(str);
         }//end while
         bRead.close();
         }catch(Exception e){
         System.err.println("in getFileAsString(): " + e.toString());
         }//end try
         return buffer.toString();
    }//end getAsString()

  • Converting 2D CAD files into 3D PDF?

    Hi there,
    I have a couple of 2D CAD drawings that I converted into PDF from Autodesk AutoCAD. I also have Adobe Acrobat 9 Pro Extended. Is there a way to convert these 2D PDFs into 3D PDFs, so that I can pan or rotate the files in XYZ space?
    Thanks!

    Without seeing exactly what you have I'd have to say I doubt very much that you can get 3D data out of this.  I imagine that your 2D CAD PDF is more or less lines and text at this point.  Very much like what you'd see if you printed it to paper.  It sounds like you've had trouble converting the original 2D CAD drawings into 3D from the originals as well.  Maybe there is some way to open the original files in a newer version of AutoCAD and save it as a file type that Acrobat's 3D conversion engine can handle, though I certainly have no experience with this approach.

  • How to get rid of blank white page next to cover page when converting an indesign file into a pdf flip book

    Hey Everyone,
    I created an catalog using indesign and now I want to convert that into a pdf flip book. I have exported it as a SWF then changing the SWF back into a pdf. It works great however, I keep getting a blank white page next too my cover page, and I really don't want this. I find it very distracting and visually unappealing. Is there any way to get rid of this blank white page? Or any other suggestions on how to create a flip book out of an indesign file.

    It sounds as if you're not checking the pagination properties of the chapter after the problem within the book file.
    The book file settings always trump the component file's settings.
    So this would mean that, if Chapter 3 is set in the book file to start on a Right page, the book enforces this by adding a blank page to Chapter 2.
    You should be able to fix this by selecting all the component chapters in the book, right-clicking and setting all the pagination properties to start on Next Available page, but I don't have 7 on this system so I can't give you the exact key strokes.
    Art

  • How do I convert a jpeg file into a pdf file?

    I would like to be able to convert a jpeg file, both in Photoshop and outside of Photoshop, into a pdf file.  How do I go about doing that?

    If you don't have Acrobat, you'll need to do it in Photoshop. File>Save as>Photoshop PDF. If it is a cmyk file, you'll need to convert it to rgb first.

Maybe you are looking for

  • Windows 7 Network Drivers No Longer Works

    Bought a MBP a week ago, just installed Windows 7 on its own partition, installed bootcamp, everything worked fine for the first day. The next day, it did not recognize my network drivers (wireless, ethernet). Control Panel states that they are not i

  • What are collaborators in java?

    hey, i was reading an article about dependency injection and it says: "Dependency Injection has several important benefits: For example -Because components don't need to look up collaborators at runtime, they're much simpler to write and maintain....

  • Getting Magic Mouse to Connect At Startup

    I'm using a Magic Mouse with Windows 7, and everything including scrolling works fine once I install the mouse. However, the mouse no longer works the next time I boot into Windows. It shows up under my devices and Windows doesn't find anything wrong

  • How to reduce email size on ipad

    Under Usage, email size is 52 GB, yet I have cleaned everything out.  How do I reduce the size to open up available space on my iPad?

  • Updates and Apple ID

    I currently have 3 updates available.  When try to update it requests me to sign into Apple ID.  But when I do, nothing happens, still do not update!  Suggesations?  Also, I have 5 different Apple IDs.  Is there a way to merge them?  It is such a PAI