Yes, that's true, but i think that changing the JVM working directory it
isn't the solution because when the application is build, all that is under
the build directory is merged in a jar file. And it is inside that jar where
i need to write because once the application's running the user wouldn't
have the build folder or somehing like this, only the application jars and
if i want access this files i need the relative path.
I've tried with FileObject OUT=
URLMapper.findFileObject(getClass().getResource("/pdf/OUT.pdf")); but i'm
not able to get the FileOutputStream (needed by iText to write the pdf) from
this FileObject.
Thank you for your help,
muleiro
Bruno Lowagie (iText) wrote:
>
> muleiro wrote:
>> Hi....i think i'm fighting against a quite simple problem but i'm afraid
>> i
>> can't resolve it.
>>
>> I create my pdf file using a FileOutputStream like this:
>>
>> FileOutputStream fos = new FileOutputStream("OUT.pdf");
>> PdfCopy copy = new PdfCopy(document, fos);
>> (...)
>>
>> And iText creates the OUT.pdf as i want but the file is placed in my
>> module
>> folder.
>
> That's the working directory of your JVM.
>
>> What i wanted is place the OUT.pdf under the build folder in order
>> to be accessed by the user.
>
> Change the working directory of your JVM to that folder.
> Read the following tips:
> http://www.roseindia.net/java/example/java/io/GetCurrentDir.shtml
> http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html
> http://www.iam.ubc.ca/guides/javatut99/essential/system/properties.html
> and so on...
>
> br,
> Bruno
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
--
View this message in context:
http://www.nabble.com/write-pdf-file-to-disk-tf2720070.html#a7595357
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/