Can I create MS-Word files or PDF files using java

We are developnig a web based application for banks and in this at some point we need to provide reports to the Banks for downloading and printing . Now I do not want to make simple .txt files ,I wan to use some sophsticated file format which look nice.
So is it possible for the server to create files in say .doc format or in say PDF format etc which the banks may download and print.
I am using java servlets and jsp as front end and java classes in middle tier and oracle is my database.

Please try this code:
import god.java.pdf.*;
PDFWriter pw=new PDFWriter(new OutputFile(new String("sample.pdf")));
pw.print("This is your text.");
pw.close();

Similar Messages

  • Hi , my problem is that i can only create absolute links to other pdf-files in a main pdf-file. how can i switch to or create relative links. Thanks for help!

    Hi , my problem is that i can only create absolute links to other pdf-files in a main pdf-file. how can i switch to or create relative links. Thanks for help!

    I’m using version 11.0.10. So where the Menu resides in a folder ready to be burnt on to a CD, that same folder is where the links point to.
    Thanks

  • How can I create a link to a pdf file and show it in the same webpage or in a new tab

    It is no problem to create a link. But the formats are limited and  - unbelievable -  the pdf format is not supported??!
    Where are the parameter (_blank or _self) to show it for example in the same webpage or in a new tab??!

    PDF is media.  It is not a web document.  Your end users must have plug-ins and helper apps installed on their device to see PDFs in browsers.  Depending on their settings, the PDF file may or may not launch in the browser window.  On my system, PDF files download and launch inside Acrobat Professional; not my browser.
    The safest approach is to provide a screenshot on your page with a direct link to the PDF file so people can handle it as they wish.  See example:  http://www.adobe.com/manufacturing/3dpdfsamples/3dsolutions/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • I Can't create and add en entry in Ldap using Java

    Hello there,
    I'm pretty new to LDAP programming, and I have been trying to create and add an entry to a directory using the code sample provided in the JNDI tutorial, but for some reasons, I didn't manage.
    the configuration file is well set up because I can't create, add, delete and modify just about anything I want from openLDAP command lines, but my real problem is to do it with java.
    here is my code:
    import java.util.Hashtable;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    import javax.naming.*;
    import javax.net.ssl.*;
    import java.io.*;
    public class Newuser
         public static void main (String[] args)
              //LDAPEntry myEntry = new LDAPEntry();
              Hashtable<String, String> env = new Hashtable<String, String>(11);
              String adminName = "CN=ldap_admin,o=JNDITutorial,dc=img,dc=org";
              String adminPassword = "xxxxxx";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial,dc=img,dc=org");
                   // Create the initial directory context
                   //JNDILDAPConnectionManager jndiManager = new JNDILDAPConnectionManagerImpl();
                  try{
                       DirContext ctx = new InitialDirContext(env);
                        System.out.println("Connection to LDAP server done" );
                       final String groupDN ="ou=people,o=JNDITutorial,dc=img,dc=org";
                      //DirContext dirCtx = jndiManager.getLDAPDirContext();
                      People people = new People("Thiru","Thiru","Thiru Ganesh","Ramalingam","ou=people","[email protected]");
                      // The Common name must be equal in Attributes common Name
                      ctx.bind("cn=Thiru," + groupDN, people);
                      System.out.println("** Entry added **");
                      //jndiManager.disConnectLDAPConnection(ctx);
                  }catch(NamingException exception){
                      System.out.println("**** Error ****");
                      exception.printStackTrace();
                      System.exit(0);
    }adn this is the class People that i want to instantiate
    import java.util.Hashtable;
    import javax.naming.Binding;
    import javax.naming.Context;
    import javax.naming.Name;
    import javax.naming.NameClassPair;
    import javax.naming.NameParser;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    public class People implements DirContext {
         public People(String uid,String cn,String givenname,String sn,String ou,String mail) {
        BasicAttributes myAttrs = new BasicAttributes(true);  //Basic Attributes
        Attribute objectClass = new BasicAttribute("objectclass"); //Adding Object Classes
        objectClass.add("inetOrgPerson");
        /*objectClass.add("organizationalPerson");
        objectClass.add("person");
        objectClass.add("top");*/
        Attribute ouSet = new BasicAttribute("ou");
        ouSet.add("people");
        ouSet.add(ou);
        myAttrs.put(objectClass);
        myAttrs.put(ouSet);
        myAttrs.put("cn",cn);
        myAttrs.put("sn",sn);
        myAttrs.put("mail",mail);
    }as I said, I can add the new entry using an LDIF file "new.txt" that looks like this:
    dn:cn=Hamido Saddo,ou=People,o=JNDITutorial,dc=img,dc=org
    cn:Hamido Saddo
    mail:[email protected]
    telephonenumber:3838393038703
    sn:hamido
    objectclass:top
    objectclass:person
    objectclass:organizationalPerson
    objectclass:inetOrgPersonusing the following command:
    ldapadd -D "cn=ldap_admin,o=JNDITutorial,dc=org,dc=img" -W -f new.txtand eveything works
    but when i try with the java, i get the following error:
    javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - entry has no objectClass attribute]
    so, can anyone help me please !!!

    uncomment these lines
    /*objectClass.add("organizationalPerson");
    objectClass.add("person");
    objectClass.add("top");*/
    you need all of them to add successfully
    your LDIF has all the four lines
    objectclass:top
    objectclass:person
    objectclass:organizationalPerson
    objectclass:inetOrgPerson
    hope this helps

  • Can't convert to word or edit pdf?

    I bought pdf995suite but can't convert to word or edit pdf files. I thought that was what I was buying. Have I done something wrong or is that function an added feature I have to pay for. Very confused

    This is the wrong place, sorry. PDF 995 is nothing to do with Adobe.
    Adobe's ExportPdF does convert to Word (sometimes)
    Adobe Acrobat does edit PDF (but rarely what people want)

  • How can I copy part of a larger PDF file and create a smaller one?

    How can I copy part of a larger PDF file and create a smaller one?

    Hi,
    Copy the content of PDF file in Adobe Reader and paset it to MS Word then create PDF file from the Word file.
    This may not work for all PDF files as some PDF files are not created correctly or some content cannot be copied.
    Acrobat XI Pro has features to extract/delete/crop pages in PDF files and you can download it from www.adobe.com(Trial version- 30 days free). Or you can upgrade your subscription to Acrobat Plus and see more information at https://www.acrobat.com/acrobatplus/en/home.html
    Hisami

  • How can I remove a signature on a PDF file that I created using Preview on iMac computer??

    How can I remove a signature on a PDF file that I created using Preview on iMac computer??  I inadvertently hit the icon on the Preview tool bar with an xS and a line through it.  There is my signature in the middle of the PDF file I was editing.  How do I get rid of it?  Cannot select it.  Cannot find any tools that allow me to delete it.  The Preview documentation tells how to create and apply a signature, but not how to remove it.  I think when a signature is added the doucment becomes locked from any editing.

    Hey needadobehelp10,
    Using Adobe Acrobat/Reader, you can simply change your PDF view settings under "View > Page Display > Single Page View"
    Is this really you wish for?
    Please let me know.
    Regards,
    Anubha

  • HT2506 hi i can't seem to copy and paste pdf files from preview to a microsoft word document. it always comes up with nonsense characters in the word document. how do i fix this? thanks in advance

    hi i can't seem to copy and paste pdf files from preview to a microsoft word document. it always comes up with nonsense characters in the word document. how do i fix this? thanks in advance

    Hi,
    The quickest way to do this (tested with OS 10.8.2, MS Word 2011) is in one line:
    tell application "Microsoft Word" to close every document whose name begins with "book"
    The reason why your script doesn't work is that you aren't specifying to Word which document you want it to close.
    So, changing one line ought to do it:
    close document incrementvalue -- instead of "close document"
    But... when you close a document, you change the document count. Document 2 becomes document 1, document 3 becomes document 2 etc. So eventually you'd get a message saying "The object you are trying to access doesn't exist".
    Because of this, if you want to do it in a repeat loop, you have to work backwards:
    tell application "Microsoft Word"
      set doc_count to count documents
      repeat with x from doc_count to 1 by -1
      if name of document x begins with "book" then close document x
      end repeat
    end tell
    Hope this helps.

  • Create HTML that links 100 PDF files in a folder

    I would like to publish my wife's recipes on our website, hoping she can then have access from the iPhone. I have about a 100 and really don't want to use iWeb to create 100 hyperlinks to a file, especially since she is continuously adding recipes.
    Does anyone have a hint that could help generate such a page?

    Does anyone have a hint that could help generate such a page?
    Try AppleScript, it's easier than you think. Here is a short script:
    -- start script
    on run
        tell application "Finder"
            -- ask for folder contains PDFs
            set recipesFolder to choose folder with prompt "Please select the folder that contains recipe PDFs"
            -- get all files name
            set recipeFileNames to name of every file in recipesFolder whose name extension is "pdf"
            -- convert folder path to POSIX so can be used with Unix command
            set posixFolderPath to POSIX path of recipesFolder
        end tell
        set DOCTYPE to "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>My Recipes</title></head><body>"
        set closeTags to "</body></html>"
        -- write DOCTYPE
        do shell script "/bin/echo " & quoted form of DOCTYPE & " > " & quoted form of (posixFolderPath & "My Recipes.html")
        -- write page title
        do shell script "/bin/echo " & quoted form of "<br/>My Recipes<br/><br/>" & " >> " & quoted form of (posixFolderPath & "My Recipes.html")
        repeat with recipeFileName in recipeFileNames
            -- write recipes entries
            do shell script "/bin/echo '<li><a href=\"" & recipeFileName & "\">" & recipeFileName & "</a><br/>'" & " >> " & quoted form of (posixFolderPath & "My Recipes.html")
        end repeat
        -- write close tags
        do shell script "/bin/echo " & quoted form of closeTags & " >> " & quoted form of (posixFolderPath & "My Recipes.html")
    end run
    -- end script
    Launch Script Editor, it can be found in /Application/AppleScript/ folder, copy& paste the script, I added comments above each line. You can run the script from Script Editor or save it as an application (File menu --> Save as..). Run the script, it'll do the following:
    1) prompt you to locate the folder which contains the PDFs
    2) make 'My Recipes.html' file in the same folder, that way you can upload the whole folder to you host.
    Be sure you *do not* have any file with the name 'My Recipes.html'.
    *If you're unsure of anything post back or make back up your important stuff (aka everthing you home folder).*
    Now, the script generates a very raw page with a list of PDF files and links to them.
    But potentially, AppleScript can generate html page with different catagories... such as: vegan, veggies or carnivore dishes... or French, Thai or Indonesian dishes... etc, etc... great for searching!
    But, you need to add those key words in the PDF file's Spotlight Comments (in Finder select an item, then hit command+i, you'll see comments field at the top on info pane).
    Spotlight Comments is meta data for Finder to find things (data base indexing).
    Lastly, you can automate all these by using AppleScript's Folder Action

  • How to upload a word document or pdf file to xk02 transaction

    hi all,
    i want to upload a word document or pdf file to xk02 trasaction
    please suggest me how todo this
    Thanks
    RAM

    Hi Pradeep,
    For creating PDF documents in Webdynpro Java you can use  "iText.jar" .
    to know more about creating PDF using iText refer these links.
    http://www.brothersoft.com/downloads/itext-jar.html
    http://www.lowagie.com/iText/download.html
    Regards
    Sridhar

  • Cant change words in my pdf file??

    why cant I  change words in my pdf file? it takes me to another page to convert files to word only and the wrong files I might add

    As PDF is not a word processing file format applications that work PDF cannot perform word processing activity.
    What can be done when using Acrobat XI is the touchup of characters and character strings.
    However if the PDF content is the output image of scanner that content is an image / a picture of text.
    To work images / pictures you'd use a photo editor (such as Photoshop Elements or such).
    You fail to specify what application you are using (Acrobat XI or Adobe Reader XI).
    If you have Acrobat you can perform OCR using Acrobat's ClearScan. The output of ClearScan OCR lends itself to doing "touchups".
    If you have Acrobat you can export the OCR output to a Word file. Needed / desired cleanup can be done using Word.
    If you have Adobe Reader you cannot modify PDF page content, create PDF or export PDF page content.
    With this situation you'd want to be subscribed to one of Adobe's online subscription services.
    There is ExportPDF and PDF Pack. With either you can go to the service's web site, sign in and then upload the PDF for processing.
    If the PDF content needs OCR you'd direct the service to do that.
    The output is a Word file. You'd for sure have to cleanup the Word file but that'd be standard word processing.
    Be well...

  • How can you insert "Page Break" in a pdf file so you will specify the pages

    How can you insert "Page Break" in a pdf file so you will specify the pages

    How / from what was the PDF originally created?  It would be easiest to insert page breaks into the original document, then recreate the PDF.

  • Adding definitions to Specific Words within a PDF file

    I have a client who wants me to add definitions to Glossary words throughout a PDF file. They want it to look like a "roll over" or when you click on the glossary word a definition pops up. Is there a way to do this in Acrobat 9 or it can't be done?

    You can achieve this with one of my custom-made tools:
    http://try67.blogspot.com/2008/11/acrobat-highlight-all-instances-of.html
    If you set the comment color to "Transparent", it will act just like a pop-up that shows when you hover with the mouse over the text.

  • How to count words in a PDF file?

    Is there any way I can count words in a PDF file without resorting to Acrobat Reader (which apparently has that feature)?
    That's a massive program, which I actually don't like.
    I need to count words in the PDF file because I write my papers with LaTeX, and they're full of my extensive comments.
    Do you know of any alternative?

    that utility IIRC cannot be found on xpdf (the official Archlinux package) anymore and its part of poppler
    edit: its pdftotext btw
    Last edited by dolby (2008-05-11 13:35:05)

  • How can you change individual words in a PDF using javascript?

    Hi,
    I am trying to do some simple text replacement in a PDF file using Acrobat. Specifically, I want to do some simple transliteration of words or partial transliteration. For instance, I would like to change a word like "red" to "ρed". This is to help me get used to the Greek alphabet step by step.
    Anyway, I downloaded Acrobat and there is no feature to do a single letter search and replace -- only word replacement. I have a Computer Science degree and decided to investigate the javascript capabilities to see if I can make those a simple letter replacement script. However, I have gotten to the point where I can cycle through every word in the PDF (using functions like getPageNthWord), and I can make a replacement on the string returned using something like: val.replace(/r/, "ρ"). However, I don't know how to replace the word in the PDF file....such as with a hypothetical function setPageNthWord (which does not exit). I have found the online documentation very thin on this, and I am scratching my head. Perhaps, it is something to do with the PDF format that I do not understand. So, is there a way to simply change text of a PDF file, like I am asking? All I am looking for is simple script to change a letter to another across a PDF.
    thanks if you can help
    Justin

    JS can't edit the text in a PDF file directly. There are workarounds, like
    using a redaction with overlay text or simply placing a new field or
    annotation on top of the old text with the new one, but they are all far
    from perfect and won't cause a "reflow" of the document, so if the two
    texts are not of the same length the result will look odd. Also there's the
    issue of which font to use (font family, color, size, etc.), which JS can't
    know so you'll have to tell it.

  • Merging word document with pdf file how do you renumber pages?

    After merging a word document with pdf file, how do you renumber pages?  The pdf has more pages than the word document.  I first converted the word document to a pdf, using Acrobat Standard 9.

    Hi Petek ,
    After you merge the files or combine files ,click on the Page Thumbnails panel on the left hand side.
    In the Page Thumbnail panel ,right click and you will get a drop down list .Select the option "Number Pages".
    You will see a dialog box with several options .You can renumber the pages from there as per your requirement.
    Regards
    Sukrit Dhingra

Maybe you are looking for