Image not found in PDF

olihya

New Member
Hello :)

At first thank you to the team for Fabrik :)

I have added a file upload for a photo in my form but impossible to display it in the pdf?
The message is "image not found" but the path is good (screen copy in attachment).

Have you an idea to resolve that?

Have a beautiful day ;-)
 

Attachments

  • ProblemImagePdf.jpg
    ProblemImagePdf.jpg
    15.2 KB · Views: 49
Is the exact path from the pdf really working?

Which Fabrik (and Joomla and PHP) version are you running?
 
Hi Troester :)

Thank you for your answer :)

Yes the path work.
When i open it in a browser it display the image.

When i set the pdf to debug it create an html page where the photo is well displayed.

It is only when it is not in debug mode and when it create the pdf file.

Joomla! 3.6.5 Stable [ Noether ] 1-December-2016 22:46 GMT
Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

And for Fabrik it is the 3.6
 
Yes, this fix was merged and is in Fabrik3.6
It's creating the URL which is shown in your PDF.

But you say with exactly this URL given in the PDF (i.e. exactly scheme, host, port) you can access the image directly?
 
Hi Friends :)
Thank you SogesComputer and Troester :)
@troester
Yes the url given in the pdf work, i can access it directly but the image is not included in the pdf.
 
It may be an SSL issue on your server. When you view the debug version, or access the URL directly, you are doing it from your browser. When the PDF is built, it's built on the server. So if there's an issue, like your CA cert bundle is out of date / not installed, or you are using a self signed certificate, the server may fail when fetching the image over https.

Best way to check would be to open an ssh session to your server, and at the command prompt try ...

wget https://your.site/path/to/image.png

Obviously replace that path with the one the PDF is trying to use. See if the wget can fetch the file, or if it gives you warnings about certificates.

-- hugh
 
Hi All,
I have the same problem after updating the site to Joomla 3.7.3 and Fabrik 3.7. (worked fine previously with older verion even my site was Https)
My previous version with Fabrick3.5.2, Joomla 3.6 + dompdf working fine with Qr-Code creation and export to Pdf. Recently, Joomla and fabrik offered me to update and I have made it.
However, the export function of QR code to Pdf failed with "Image not found ...". I tried googling and found others are also stucked at this problem.
I found that Dompdf has been merged and update uder fabrik 3.7 but dont know how to shoot the problem.
Can you please support me on this point?
http://vie036.sfdp.net/index.php?op...ment_id=140&formid=11&rowid=164&repeatcount=0
Above is the link to the Qr-Code and it failed to export to pdf (i knew this is something relate to file path but have no idea how dompdf handles temporary file).
 
I doubt that's the problem, unless a) user_defines.php exists (which for most people it shouldn't, unless they installed Fabrik from a specific 3.3.x release where it crept in to the ZIP), and b) the "Allow user defines" global config setting has been explicitly set to Yes.

More detail than you need ...

Code:
    public function onAfterInitialise()
    {
        jimport('joomla.filesystem.file');

        /**
        * Added allow_user_defines to global config, defaulting to No, so even if a user_defines.php is present
        * it won't get used unless this option is specifically set.  Did this because it looks like a user_defines.php
        * managed to creep in to a release ZIP at some point, so some people unknowingly have one, which started causing
        * issues after we added some more includes to defines.php.
        */
        $fbConfig         = JComponentHelper::getParams('com_fabrik');
        $allowUserDefines = $fbConfig->get('allow_user_defines', '0') === '1';
        $p                = JPATH_SITE . '/plugins/system/fabrik/';
        $defines          = $allowUserDefines && JFile::exists($p . 'user_defines.php') ? $p . 'user_defines.php' : $p . 'defines.php';
        require_once $defines;

        $this->setBigSelects();
    }


-- hugh
 
I doubt that's the problem, unless a) user_defines.php exists (which for most people it shouldn't, unless they installed Fabrik from a specific 3.3.x release where it crept in to the ZIP), and b) the "Allow user defines" global config setting has been explicitly set to Yes.

More detail than you need ...

-- hugh
No, it is the detail I need.:cool:

Because, I have a user_defines.php - and I don't ever remember putting it there - unless at some point I wanted to test it out and forgot about it (which is also possible I guess).

...And that's why I'm thinking that this might be the problem for anyone else having troubles with issues that might arise if the COM_FABRIK_LIBRARY constant is not initialized - because of overlooking changes to defines.php that should have been put into user_defines (Or forgetting that 'feature' was turned on).

I had no idea why there was both a defines.php and a user_defines.php - until you just refreshed my memory. Now I remember when that was done.

I do know that line is the only line that was in my defines.php that was not in my user_defines.php file - and the error I was getting came from... components/com_fabrik/views/list/view.base.php line 504 calling canPdf().

I'm just trying to help. And if this solves a mystery, all the better - and it's something to keep in mind for any future situations where something similar might come up (with a php error stemming from an undefined COM_FABRIK_LIBRARY).
 
Last edited:
Hi all,
I found a strange behavior and just want to share this with you so for finding a solution.
Requirement: Want to export QrCode to Pdf so user can track Qr-Code of product.
Pdf template: same pdf template as attached to this post.
DomPdf: as provided by Fabrik 3.7, github (lastest)
Test:
Case 1:
Make a simple list base on ward table, setting ward name to Qr code, pdf template (pdfExport - as above). At exporting the file, pdf is made and with Qr-code (see file homepage.zip below);
Case 2: Make a full list for label printing, setting PackageLink to be Qr-Code a sample of the link for creating the code as below: https://agricb.sfdp.net/scan/89300076000077d004ad8f6b111e6a6430cc47acc9030
At exporting to the pdf, dompdf said: Image not found or type unknown.
Live test case can be seen here, please use test/test for user and password
https://inforcb.sfdp.net/index.php/vi/ - case 1 success
and
https://inforcb.sfdp.net/index.php/vi/product-code - case 2 failed

To try finding the problem, I discovered that dompdf will create pdf for qr-code image if the list is based on a physical table but not a view.
https://inforcb.sfdp.net/vi/product-code-test.html

Thank you very much for your supports
Dang Dinh Ngoc
From Viet Nam
 

Attachments

  • pdfExport.zip
    6.2 KB · Views: 21
  • homepage.zip
    748.6 KB · Views: 28
Last edited:
As this is such a corner case issue ("QR code won't build in PDF's from lists based on views"), and probably only affects one user (you), I can't really devote any time for it in the free Community forums. If you'd like to take out a paid sub for a month, I'll see if I can replicate / fix it on my test site.

I'm assuming you included a unique id in your view, and manually set that as the PK in the list settings?

-- hugh
 
As this is such a corner case issue ("QR code won't build in PDF's from lists based on views"), and probably only affects one user (you), I can't really devote any time for it in the free Community forums. If you'd like to take out a paid sub for a month, I'll see if I can replicate / fix it on my test site.

I'm assuming you included a unique id in your view, and manually set that as the PK in the list settings?

-- hugh
Hi and thank you for you reply..
After sometime getting around with suspecting on time needed for html to be rendered, I found that querying time for data source would substantially be a factor to cause dompdf to not creating qr-code successfully in the end.
From that perspective, I tried rewriting all queries and view to minimize time for page rendering and now all worked!
Thank you very much for your attention Hug for all your valuable efforts supporting those people like me!
I will have some work for paid subscription soon.
 
Hi there,

I used to have a very nice format pdf, after update to 3.8.1, the image not found.

What might the error ? as i follows all the instruction troubleshoot above and not working.

Thank you
 
Hi all,
I have this problem happened again after updating fabrik from 3.8.1 to 3.9,
Export Pdf is not show but "Image Not found"
To avoid server problem in querrying the address, I made a static host file for ubuntu 18/04 (it worked before and successfully created pdf with Qr code image using dompdf)
and after updating yester day to 3.9, it failed generating QR code image for displaying in Pdf file.
I know this is cumbersome to you but, I am hopeless on seeking way to solve it.
I check with wget on the server for the following image and it returned html content of the home page but the image however, viewing on browser the image still correctly displayed.
https://nongnghiep.caobang.gov.vn/i...ent_id=165&formid=12&rowid=1067&repeatcount=0

Please help me with thanks.
Thank you very much for your attention.
I can give you details for accessing the server. my skype is paulsteigel.
 
Last edited:
Did you hack some Fabrik core file which may be overridden by the update?
No Sir,
The only thing I made was making the Size of pdf paper size
Large_code.png

Originally, it exported like this
The modification is made to list.xml in the fabrick for selection of paper size as below:
Line 996
<option value="qrcodesmall">qrcodesmall</option>
<option value="qrcode">qrcode</option>
<option value="godex">godex</option>
and this size has been made on dompdf as well:

Line 45-49 on CPDF.php
static $PAPER_SIZES = array(
"qrcodesmall" => array(0,0,74,94),
"qrcode" => array(0,0,74,100),
"godex" => array(0,0,283.46,125),

Now it exported like this (no image):
upload_2018-11-21_15-45-44.png
Please support me with thanks!
(I doubt due to the server query speed for ajax creation of image.
Also, there is a case that I make a simple QR code from non union/join query, it has successfully created! So strange:
https://nongnghiep.caobang.gov.vn/i...w&element_id=2&formid=1&rowid=2&repeatcount=0
upload_2018-11-22_9-19-58.png
and here with https://nongnghiep.caobang.gov.vn/home-3/generalintro.html
upload_2018-11-22_9-24-33.png
Finally, I moved to Mpdf but hopeless as Mpdf does not happily want to work with QR code on Ajax base! It thrown this message
"Error creating PDF: Invalid size representation "auto \9"
each time I turn a field to be QR code, without QRcode- it works just fine!

I have once subscribed for paid support but I had not been supported regarding my questions, so I would like to just post things here with hope that anyone may do some sharing with thanks.
 
Last edited:
Do you have any ACL's on the form / elements? In other words, does viewing the form / details view require the user to be logged in?

If so, that would potentially be a problem for PDF rendering, as the call to build the QR image, with the server calling itself, will be as "guest" (the server doesn't have your session credentials).

You said somewhere up there ^^ that doing a 'wget' gives you the home page instead of the image, which would indeed be what would happen if the List has access controls for "view records".

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top