No pictures when saving pdf

More
3 weeks 3 days ago - 3 weeks 3 days ago #33 by Alex-Mata
Hello. The component is great, but an oddity has arisen. On one site the questionnaire in pdf is saved with pictures, but on the other site - without pictures, only squares. The path to the pictures is completely - with the domain. And when adding a media field with multiple photos, a json_decode() error occurs: Argument #1 ($json) must be of type string, array given
Last edit: 3 weeks 3 days ago by Alex-Mata.

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #34 by shane
Replied by shane on topic No pictures when saving pdf
Hello,

Thank you for your message and for the positive feedback on the component!

If I understand correctly, you’re facing two issues:

1. Some images are not displaying in the PDF and are appearing as squares.

2. You're encountering a JSON decode error when using multiple images.

For the first issue:

Do the images exist on the site, and do the paths appear correct? Are you able to access the images directly using the paths generated in the PDF? If the images exist and the paths are correct, this could indicate a file access permissions issue.

For the second issue:

Could you provide more details on how the field is set up? Are you using an image list field or another custom field? A screenshot of the field setup would also be helpful.
Additionally, could you enable site debugging and send the stack trace or, at minimum, the file and line number where the JSON decode issue occurs?

With this information, we’ll be able to diagnose the problem more effectively and provide a solution.

Thank you!

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #36 by Alex-Mata
Good afternoon
I apologize in advance, I use GPTChat for translation :) I hope the message will be clear.
Yes, that's right, two problems:
1. No images are displayed in the generated PDF. Moreover, I add the image directly to the template, through the Basic-Image panel and it is visible in the template, but when generating a PDF, it is replaced by a crossed-out square. The same thing happens with images inserted as a dynamic field, for example Image-Intro (it is not displayed in the template). The images exist, and the paths are correct, images are displayed when viewing the material page. Did you suggest viewing the paths generated in PDF? Can you tell me how to do this?
2. For the second problem, the situation is as follows. We had a test site on which all the ok images from the template and from the custom template fields are generated, i.e. everything is ok.  But when adding a field containing several images to the template, the error described above occurs. (json_decode(): Argument #1 ($json) must be of type string, array given). The fields in which there is one image and with which everything is ok on the test server contain the following entries {"imagefile":"images\/160824\/5ec270b4bb2e9480b13d2e3cdcf4519bdb653dd3.jpeg ","alt_text":""}. Entries that contain multiple images have the following format {"row0":{"field225":{"imagefile":"images/160824/17cdbc8d72656463a8c9f76cf7cc3dfdcc328b97.jpeg#joomlaImage://local-images/17cdbc8d72656463a8c9f76cf7cc3dfdcc328b97.jpeg?width=585&height=667","alt_text":""}},"row1":{"field225":{"imagefile":"images/160824/30e7dcd5f98eb92743ca254fb64a0651de986977.jpeg#joomlaImage://local-images/30e7dcd5f98eb92743ca254fb64a0651de986977.jpeg?width=585&height=667","alt_text":""}}} and when using fields containing similar entries, the json_decode() error crashes on the test: Argument #1 ($json) must be of type string, array given).

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #37 by shane
Replied by shane on topic No pictures when saving pdf
Thank you for providing the detailed explanation of the issues you're experiencing. To help diagnose and resolve these problems more effectively, I would need to examine the system configuration and specific files involved. Could you please provide either:

Access to your test server, credentials can be sent to me securely at shane@com3elles.com, or
A backup of your site.

This will allow me to investigate both the image display issue and the JSON decoding error directly and provide a proper solution.

Looking forward to helping you resolve these issues.

Please Log in or Create an account to join the conversation.

More
3 weeks 23 hours ago #38 by shane
Replied by shane on topic No pictures when saving pdf
Hi, I forgot to mention that you can view the HTML used to generate the PDF by enabling the debug option. You can access it either from the File Edit view by going to Actions > Debug, or from the Files List view as outlined in the documentation: PDF Generator Documentation - Files List View .
Attachments:

Please Log in or Create an account to join the conversation.

More
2 weeks 2 days ago #39 by shane
Replied by shane on topic No pictures when saving pdf
Issue Resolved

For anyone facing a similar issue, please ensure you’re using a valid SSL certificate when working over HTTPS. Without this, dompdf will not be able to render images.

We are investigating this issue to implement a solution that will help prevent it in the future. In the meantime, if you encounter this issue, confirm that your SSL certificate is valid.

For any external images that aren’t displaying, please also verify that the SSL certificate of the resource is secure and compliant. Otherwise, the image will not be displayed.

Please Log in or Create an account to join the conversation.

Login

We can create your own desire

You need a component a plugin , module or template ourteam is compose by Joomla! administrator certified, Designer and fullstack dev. 

Secure payment

by Paypal and Stripe

    

Copyright Com'3Elles @ since 2023
https://extensions.com3elles.com  is not affiliated with or endorsed by the Joomla! Project or Open Source Matters. The Joomla!® name and logo is used under a limited license granted by Open Source Matters, the trademark holder in the United States and other countries.