You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Max Peak <ma...@gmail.com> on 2017/06/14 17:10:46 UTC

Static PDF by file ID

 

 

Hi All

 

I would like to retrieve a static PDF file from ofbiz. Here's the scenario:
Web page link calls javascript function to load file to pdf viewer object in
div using  object.data=somerequest?FileID.

 

The documentation seems confusing on this point, always pointing to some
process to create a pdf and download it.

 

What I would like to do is (from browser) include a file ID with the request
to the server, forward it to a groovy script to find or retrieve the file,
then pass the file (or a pointer to it) to  screen widget or FTL to return
file to browser as application/pdf  mime type.

 

So, how does one include an argument with a request, then use it on the
server side?

Is it possible to pass a file through the context? (ie., from groovy to FTL
as a file object)

Is this a view-map type screenfop or simpleContent?  Or is it a reponse type
view at all?

 

Many thanks to the experts out there. 

 

Max

 

 

 


Re: Static PDF by file ID

Posted by Michael Brohl <mi...@ecomify.de>.
Hi Max,

see UtilHttp.streamContentToBrowser(...). You'll find some examples in 
the OFBiz codebase.

Regards,

Michael Brohl
ecomify GmbH
www.ecomify.de


Am 14.06.17 um 19:10 schrieb Max Peak:
>   
>
>   
>
> Hi All
>
>   
>
> I would like to retrieve a static PDF file from ofbiz. Here's the scenario:
> Web page link calls javascript function to load file to pdf viewer object in
> div using  object.data=somerequest?FileID.
>
>   
>
> The documentation seems confusing on this point, always pointing to some
> process to create a pdf and download it.
>
>   
>
> What I would like to do is (from browser) include a file ID with the request
> to the server, forward it to a groovy script to find or retrieve the file,
> then pass the file (or a pointer to it) to  screen widget or FTL to return
> file to browser as application/pdf  mime type.
>
>   
>
> So, how does one include an argument with a request, then use it on the
> server side?
>
> Is it possible to pass a file through the context? (ie., from groovy to FTL
> as a file object)
>
> Is this a view-map type screenfop or simpleContent?  Or is it a reponse type
> view at all?
>
>   
>
> Many thanks to the experts out there.
>
>   
>
> Max
>
>   
>
>   
>
>   
>
>