Serving a PDF in a JAVA Agent

Hello,

Do you know if it is possible :

  1. Invoking an ?openagent URL from the browser

  2. Open a database and get the document which contains the PDF in a richtext field.

  3. Serve the PDF in a stream back to the browser

I’m wondering if it is possible to do it smartly in a notes agent. ( i don’t want to have to write a servlet, which means a lot of administration issues.)

Best regards

Subject: Serving a PDF in a JAVA Agent

Should be able to do it. In the agent create the url for the pdf e.g.

url=“http://” & server & “/” & databasepath & “/0/” & docid & “/$file/” & filename

Then add the line:

Print {}

This should replace the agent output with the required file.

hth

Pete

Subject: RE: Serving a PDF in a JAVA Agent

Thank you Pete,

But what about the security context ? the database where are the PDFs is not available to the user. It is the agent which grant the access to the PDF.

I already tried to do this but with no success, that why I was looking for a way to serve directly the PDF from the agent…

Any ideas ?

Regards.

Subject: RE: Serving a PDF in a JAVA Agent

Hi

It depense.

The agent runs with rights of the signer of the agent as default.

You can make run with the rights of the web user by selecting this in the agent properties or selecting it to run with the rights of another user.

brgds

Jesper Kiaer

http://www.jezzper.com

Subject: RE: Serving a PDF in a JAVA Agent

Sorry, the * should have been an &. Just noticed you mentioned Java as well. Similar thing can be achieved by creating a PrintWriter object and using that to write to the browser.