HI,
I am pretty new to this group and
I am trying to answer your questions. Kindly correct me if I am wrong.

1. File path in windows and linux

In your bean or servelt wherever you create the pdf, get the system
properties.
The current set of system properties is returned as a Properties object.

System.getProperties
public static Properties getProperties()
The current system roperties isdetermined.
os.name gives the os name as windows or linux

Then you can set a variable say
 linuxPath = "/usr/local/sbin/sample.pdf";
 windowsPath = "C:\\test\\sample.pdf";

and

String outputPath = new String();
Properties sysProps = System.getProperties();
String os = sysProps.getProperty("os.name")
if os.startsWith("Windows")
outputPath = linuxPath;
else
outputPath = windowsPath;

PdfWriter.getInstance(document, new
FileOutputStream(outputPath);

If this does not work or throws an ecception then ask the browser security
manger for System.getProperties("os.name");

2. > Other Question, How can generate the files on the
> client machine if the application is ruunning on a web
> server with Apache Tomcat?

I am not sure if we could generate files on the clinets machine, for
security reasons.
You will have to generate it on your page, or on your server and email it to
the client.

regards
Don S

----- Original Message -----
From: "Nairo Granados Martinez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 10:48 AM
Subject: [iText-questions] Generate physical files under Linux and
Windows...


> Hi All,
>
> I'm bulding and Application with JSP, Javabeans and
> Firebird.
>
> This application has to work under linux and windows
> enviroment and now everything goes OK.
>
> I'm using i-text to generate PDF report from the
> aplication, but I'm having some problems.
>
> In My Local Machine, I'm working with Windows 98 and
> Apache Tomcat 4.1.
>
> To create the PDF I'm using this line:
>
> PdfWriter.getInstance(document, new
> FileOutputStream("TestPDF.pdf"));
> This generate the PDF on this path "C:\WINDOWS\Men�
> Inicio\Programas\Apache Tomcat 4.1"
> I Cannot use a absolute path like
> PdfWriter.getInstance(document, new
> FileOutputStream("C:\\TestPDF.pdf"));
>
> Because it is not going to work under linux (The web
> server is under linux and it is using Apache Tomcat as
> well).
>
> What I want to do is to set the path to make it work
> under Windows and linux with any change of code.
> I want to put the resulting files under the
> Application path: e.g.
> http://127.0.0.1:8080/aldia/Reports/TestPDF.pdf to
> allow the user to donwload from the server and not
> generate them locally on the client machine.
>
> Other Question, How can generate the files on the
> client machine if the application is ruunning on a web
> server with Apache Tomcat?
>
> Thanks in advance.
>
> Nairo Granados
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to