Ranch Hand
Create a PDF document with submitted XML data by using the Forms, Output, and Document Management API (Java): Include project files Include client JAR files, such as adobe-forms-client.jar, adobe-output-client.jar, and adobe-contentservices-client.jar in your Java project’s class path. How to Create a PDF Document from a Java Program Using iText. Java programmers sometimes need to create document files of their application data to. One needs to add into pom.xml to work out the following examples.
posted 4 years agoI am trying to create a file on Linux machines using Java code.
Using the code I am able to create a file on Windows but the jar does not work on Linux platform.
Cant we create a flat file on Linux using the same code ?
Using the code I am able to create a file on Windows but the jar does not work on Linux platform.
Cant we create a flat file on Linux using the same code ?
Marshal
![Java create new file Java create new file](/uploads/1/2/5/8/125855901/818142319.jpg)
Please explain more; we can only help if we know all the details. There should not be any difference between creating a file on Windows速 and on Linux; the PATHs have a different format, obviously. Tell us how you are trying to create such a file. Also find out whether the location you are trying to create it is accessible for writing or not.
Ranch Hand
posted 4 years agoRanch Hand
posted 4 years agohi, the jar does not work on Linux platform.
Does Linux machine configured properly to run simple java code/jar?
Thanks Campbell Ritchie for clarifying about Path.
Thanks Santosh Kumar Nayak for sharing small piece of code.
I write following code with the help of Google search:-
![Create Pdf File Using Java Example Create Pdf File Using Java Example](https://www.gnostice.com/images/newsletter/2010_05_PJ_PDF_File_Attachment_Annotation.png)
Millions saw the apple fall, but Newton asked why.
Ranch Hand
posted 4 years agoLinux machine is configured properly but the above code is not able to generate a *.txt file on Linux Box.
lowercase baba
posted 4 years agoare the permissions on the directory set to allow writing to the dir?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Marshal
posted 4 years ago/root/Desktop???
That is most unlikely to be accessible for writing. I suggest you change /root to a tilde and try writing it on your desktop ~/desktop/...
Please confirm whether it is desktop or Desktop; it matters on Linux.
That code needs a bit of editing. You don't need the two try blocks; apart from the names of the files they are identical. You should also close the writers in a finally (or use try‑with‑resources).
That is most unlikely to be accessible for writing. I suggest you change /root to a tilde and try writing it on your desktop ~/desktop/...
Please confirm whether it is desktop or Desktop; it matters on Linux.
That code needs a bit of editing. You don't need the two try blocks; apart from the names of the files they are identical. You should also close the writers in a finally (or use try‑with‑resources).
Saloon Keeper
posted 4 years agoI think the 'tilde' thing is a shell artifact and it won't work properly within Java program code. However there's a java.lang.System Property that returns the path of the current user's home directory. It can be used to construct an appropriate File object. Something similar to:
Note, by the way that that particular code works equally well regardless of whether it's running on Windows or on Linux.
Note, by the way that that particular code works equally well regardless of whether it's running on Windows or on Linux.
Being persecuted doesn't in any way prove your righteousness or your beliefs. Many people get persecuted because they are repugnant or annoying. Or just because they can be.