cancel
Showing results for 
Search instead for 
Did you mean: 

Image not seen in PDF when inserted from alfresco repository

juilee
Champ in-the-making
Champ in-the-making
Hi, when I insert an image in HTML and convert it to PDF through a rule, the image is not seen in the PDF. Strangely, if the image is on some remote server except alfresco repository, it can be seen. So, it has problem only with showing Alfresco repository images. Please suggest as how this problem can be overcome?
Thanks a lot in advance.
8 REPLIES 8

afaust
Legendary Innovator
Legendary Innovator
Hello,

the only sure way I know is to make the image accessible without authentication and use a non-authenticated URL to include it in the HTML. This particular issue is due to the fact that the HTML to PDF conversion is performed by an external tool (typically OpenOffice / LibreOffice) which has to get the image via HTTP from Alfresco. Since an image in Alfresco is typically under access control and requires authenticated access, the external tool can't get to the image because it can't authenticate.

Regards
Axel

juilee
Champ in-the-making
Champ in-the-making
Hi Axel, Thanks a lot for replying. I will surely try that. How do I make the image accessible without authentication? I am not giving any explicit authentication in my code, it might be using a default one. I am calling a Javascript code for including the URL image link in the HTML page. The URL looks something like this with guest=true authentication.

http://127.0.0.1:8081/share/proxy/alfresco/api/node/content//workspace/SpacesStore/665061a4-eeda-4ad....

It lets me view the image without logging in, but still the image cannot be seen in the PDF.


Thanks!

afaust
Legendary Innovator
Legendary Innovator
Hello,

I am actually unfamiliar with the guest=true authentication and it sure does not work in any environment (4.1 / 4.2 Enterprise) that I have at my disposal - is it some custom feature that you have included in your Alfresco.

The only sure-fire way of providing unauthenticated access is to give the "guest" user consumer permission on the piece of content and then using the guest download server on the Repository to construct the URL.

http://127.0.0.1:8080/alfresco/guestDownload/direct/workspace/SpacesStore/665061a4-eeda-4ad4-9717-1f...


Regards
Axel

juilee
Champ in-the-making
Champ in-the-making
Hi Axel, I followed this link and set the guest=true authentication:
http://wiki.alfresco.com/wiki/URL_Addressability

I have given the users the consumer permission. I didn't understand the last part of your reply. Can you please elaborate?
Also, even if I try to view this PDF as an admin, the images are not visible.

Thanks,
Juilee

afaust
Legendary Innovator
Legendary Innovator
Hello,

from the wiki article you've linked <cite>The Guest user must have access to the item referenced by the URL or the access attempt will fail.</cite>

There is a special user called "guest" and that user must be consumer on the file. That user must be given the consumer permission via "Manage Permissions".

Trying to view the PDF rendition as admin will not change anything since the external process (OpenOffice) will still use an unauthenticated request to retrieve the content.

Regards
Axel

juilee
Champ in-the-making
Champ in-the-making
Hi, Thanks for the detailed reply. I am trying to add the guest user as a site member and give him consumer permission. But the problem is the invitation is not sent as the guest doesn't have an email. I tried modifying the user details through share and explorer for guest user but there is no such option to modify. Without the guest user email I am not able to add the user to the site and check if the PDF rendering works.
Thanks !

afaust
Legendary Innovator
Legendary Innovator
Hello,

you can add the guest user via the Admin Console tools by adding it to the consumer group of the site - if you are an administrator. You do not have to use the regular invitation for that.

Regards
Axel

juilee
Champ in-the-making
Champ in-the-making
Hi, I tried accessing it as a guest user. So basically, to iterate over the steps, I did the following:
- Add the guest user to my website.
- Gave him consumer role.
- Added guest=true. to the html link which gets converted to PDF
(http://127.0.0.1:8081/share/proxy/alfresco/api/node/content//workspace/SpacesStore/665061a4-eeda-4ad....)

- Still the same issue (cannot view the image in PDF)