Quantcast

Html to Pdf combinet with CKEditor and Rendering plugin

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Html to Pdf combinet with CKEditor and Rendering plugin

dangar
I have gsp where is output from CKeditor. This gsp is than processed by Renedring plugin. Everything works ok except pictures.
To be more specific, pictures are working when they are taken outside of grails application.
So if I define this (on port 8080 is tomcat container):
<img alt="does not working image" src="http://localhost:8080/App/uploads/Image/commercial-building-icon.png" 
style="width: 50px; height: 50px; "/>
image will be not shown in pdf output.
But if I define this - or any external link (on port 80 is Apache server)
<img alt="working image" src="http://localhost/somefolder/uploads/Image/commercial-building-icon.png" style="width: 50px; height: 50px; "/>
image will be shown in pdf output.

Only exception, when it is working directly from grails applicaion is when resource is defined by resource tag (in absolute form). But this is not solution in case of images uploaded and linked by CKEditor.

Uploaded file by CKEditor are only shown in html output but when pdf is rendered, there is nothing.

(I am not using relative paths.)

Anyone knows what is blocking rendering images in pdf?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Html to Pdf combinet with CKEditor and Rendering plugin

wwwclaes
I'm afraid I can't give you a specific answer, but this is often the cause when rendering works in HTML but not PDF:

"All links to resources (e.g. images, css) must be accessible by the application . This is due to the linked resources being accessed by application and not a browser. Depending on your network config in production, this may require some special consideration."

The problem may be due to some network config.

/Claes

> Date: Fri, 8 Jun 2012 08:38:21 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: [grails-user] Html to Pdf combinet with CKEditor and Rendering plugin
>
> I have gsp where is output from CKeditor. This gsp is than processed by
> Renedring plugin. Everything works ok except pictures.
> To be more specific, pictures are working when they are taken outside of
> grails application.
> So if I define this (on port 8080 is tomcat container):
>
> image will be not shown in pdf output.
> But if I define this - or any external link (on port 80 is Apache server)
>
> image will be shown in pdf output.
>
> Only exception, when it is working directly from grails applicaion is when
> resource is defined by resource tag (in absolute form). But this is not
> solution in case of images uploaded and linked by CKEditor.
>
> Uploaded file by CKEditor are only shown in html output but when pdf is
> rendered, there is nothing.
>
> (I am not using relative paths.)
>
> Anyone knows what is blocking rendering images in pdf?
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Html-to-Pdf-combinet-with-CKEditor-and-Rendering-plugin-tp4629811.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Html to Pdf combinet with CKEditor and Rendering plugin

dangar
Thanks for the answer.

I did more research and I found that problem is in Spirnt Security Plugin. When I disabled it, all images are now perfectly shown in PDF.

Only what I don't understand now is why the same image (with absolute path) is perfectly accessible in browser and when I copy/paste lint to PDF source, it is blocked by Spring Security Plugin.
I thought that login is valid for a whole session, so when I am logged as user xy and I am able to see it in browser than any task executed inside application using my session will have the same rights for the given resource.

/Jiri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Html to Pdf combinet with CKEditor and Rendering plugin

wwwclaes
I believe that is in line with my previous guess. You are logged in via the browser and are allowed to fetch the images. The application itself is not a logged in user, when it tries to fetch the images via the Rendering plugin Spring Security says no.

You either have to make images available to all or possibly only make them available to logged in users _and_ not logged in users from the local machine.

/Claes

> Date: Mon, 11 Jun 2012 02:14:21 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: [grails-user] RE: Html to Pdf combinet with CKEditor and Rendering plugin
>
> Thanks for the answer.
>
> I did more research and I found that problem is in Spirnt Security Plugin.
> When I disabled it, all images are now perfectly shown in PDF.
>
> Only what I don't understand now is why the same image (with absolute path)
> is perfectly accessible in browser and when I copy/paste lint to PDF source,
> it is blocked by Spring Security Plugin.
> I thought that login is valid for a whole session, so when I am logged as
> user xy and I am able to see it in browser than any task executed inside
> application using my session will have the same rights for the given
> resource.
>
> /Jiri
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Html-to-Pdf-combinet-with-CKEditor-and-Rendering-plugin-tp4629811p4629867.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Html to Pdf combinet with CKEditor and Rendering plugin

dangar
Ok, thanks a lot for pointing me to solution for my problem :)

/Jiri

2012/6/11 Claes Svensson [via Grails] <[hidden email]>
I believe that is in line with my previous guess. You are logged in via the browser and are allowed to fetch the images. The application itself is not a logged in user, when it tries to fetch the images via the Rendering plugin Spring Security says no.

You either have to make images available to all or possibly only make them available to logged in users _and_ not logged in users from the local machine.

/Claes

> Date: Mon, 11 Jun 2012 02:14:21 -0700
> Subject: [grails-user] RE: Html to Pdf combinet with CKEditor and Rendering plugin

>
> Thanks for the answer.
>
> I did more research and I found that problem is in Spirnt Security Plugin.
> When I disabled it, all images are now perfectly shown in PDF.
>
> Only what I don't understand now is why the same image (with absolute path)
> is perfectly accessible in browser and when I copy/paste lint to PDF source,
> it is blocked by Spring Security Plugin.
> I thought that login is valid for a whole session, so when I am logged as
> user xy and I am able to see it in browser than any task executed inside
> application using my session will have the same rights for the given
> resource.
>
> /Jiri
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Html-to-Pdf-combinet-with-CKEditor-and-Rendering-plugin-tp4629811p4629867.html

> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>



If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Html-to-Pdf-combinet-with-CKEditor-and-Rendering-plugin-tp4629811p4629880.html
To unsubscribe from Html to Pdf combinet with CKEditor and Rendering plugin, click here.
NAML

Loading...