Hallo
Ich habe die phpMyFAQ Installation in einem Verzeichnis mit Passwortschutz Installiert damit nur eine bestimmte Personengruppe darauf zugreifen kann.(Mein Chef möchte das (noch) nicht wegen Betriebsinterna!).
Jetzt habe ich natürlich schon Beiträge erstellt und dabei festgestellt das der pdf.EXPORT unterschiedlich auf Bilder/Fotos reagiert.
Wenn ich die Bilder aus dem Verzeichnis /faq/images in Beiträge verwende dann bekomme ich bei einem pdf.EXPORT folgende Fehlermeldung:
TCPDF ERROR: [Image] Unable to get image: http://faq.meineseite.de/images/562435623.jpg
Wenn ich die Bilder von externen Internetseiten (http://www.andere-internetseite.de/images/562435623.jpg) in einem Beitrag verwende dann bekomme ich bei einem pdf.EXPORT, in dem die Bilder richtig angezeigt werden.
Kann man das irgendwie ändern?
Gruß
Guido
Passwortschutz auf Verzieichnis /faq
Moderator: Thorsten
Passwortschutz auf Verzieichnis /faq
phpMyFAQ Version 2.8.8
Server Software Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
phpMyFAQ installation path C:/xampp/htdocs/phpmyfaq
PHP Version 5.4.7
Database Server mysql
Database Server Version 5.5.27 / mysqlnd 5.0.10
Server Software Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
phpMyFAQ installation path C:/xampp/htdocs/phpmyfaq
PHP Version 5.4.7
Database Server mysql
Database Server Version 5.5.27 / mysqlnd 5.0.10
Re: Passwortschutz auf Verzieichnis /faq
Hi,
geht das ohne dem Schutz auf http://faq.meineseite.de/images/562435623.jpg? Wenn nein, dann nimm den Ordner images/ raus aus dem Schutz.
bye
Thorsten
geht das ohne dem Schutz auf http://faq.meineseite.de/images/562435623.jpg? Wenn nein, dann nimm den Ordner images/ raus aus dem Schutz.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Passwortschutz auf Verzieichnis /faq
Hi,
I have similar error, but as I don't understand german I can't read your solution Thorsten so I registred and I post here.
When I try export, if I have image included in the body of text (ctrl c / ctrl v inside wysiwyg editor), I get the following pdf export error :
If I remove intext images, it works.
I digged a bit and found this that is related : https://github.com/thorsten/phpMyFAQ/issues/359
So could it be possible for you to remove base64 images from the export? Then TCPDF will work whatever happens.
Also when I use tcpdf export, is it supposed to display attached images inside the pdf ? Because I attached .gif files to my KB articles, and they don't display in the pdf.
Thanks for your help.
Edit : Found out that editing
Commenting out this line (phpmyfaq/inc/libs/tcpdf/tcpdf.php 7549):
Removes the error, the pdf gets generated and is ok (but without the in-text image, but eh, it's better than nothing)
Any luck that this will work in the future ?
I have similar error, but as I don't understand german I can't read your solution Thorsten so I registred and I post here.
When I try export, if I have image included in the body of text (ctrl c / ctrl v inside wysiwyg editor), I get the following pdf export error :
Code: Select all
TCPDF ERROR: [Image] Unable to get image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ4AAAEFCAI........................................................................ characters goes on
I digged a bit and found this that is related : https://github.com/thorsten/phpMyFAQ/issues/359
So could it be possible for you to remove base64 images from the export? Then TCPDF will work whatever happens.
Also when I use tcpdf export, is it supposed to display attached images inside the pdf ? Because I attached .gif files to my KB articles, and they don't display in the pdf.
Thanks for your help.
Edit : Found out that editing
Commenting out this line (phpmyfaq/inc/libs/tcpdf/tcpdf.php 7549):
Code: Select all
# $this->Error('[Image] Unable to get image: '.$file);
Any luck that this will work in the future ?
Re: Passwortschutz auf Verzieichnis /faq
HI,
well, this depends on the TCPDF library, if it'll support base64 encoded images we'll do, too.
Sorry for that!
bye
Thorsten
well, this depends on the TCPDF library, if it'll support base64 encoded images we'll do, too.
Sorry for that!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Passwortschutz auf Verzieichnis /faq
Hi,
I digged a bit ...
In fact tcpdf doesn't need to support base64, all you have to do is base64_decode() the img data to make it understand it.
But somehow, phpmyfaq code replace '+' symbols by ' ' so it make base64_decode crash.
I don't have the time to search where in the phpmyfaq's code it act like this, since the mysql database contains the correct '+' symbols.
Anyway, here is a proof of concept that I used to make a correct pdf including an embedded image :
Just after the function Image() declaration :
Add the following code :
(I added chunk_split as an user suggested at php.net/base64_decode, because it should work better with large base64 encoded content)
It works, but it's ugly
Maybe you could include this into the phpmyfaq code instead of tcpdf class as I did ? (I would have done it, but don't know where).
What I'm not understanding is attached files to faq are not included in pdf file. I attached a 50kb jpg file to a sample faq article, and it doesn't get included into the pdf (with or without my modification to the code).
Any idea why ?
I digged a bit ...
In fact tcpdf doesn't need to support base64, all you have to do is base64_decode() the img data to make it understand it.
But somehow, phpmyfaq code replace '+' symbols by ' ' so it make base64_decode crash.
I don't have the time to search where in the phpmyfaq's code it act like this, since the mysql database contains the correct '+' symbols.
Anyway, here is a proof of concept that I used to make a correct pdf including an embedded image :
Just after the function Image() declaration :
Code: Select all
public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array()) {
Code: Select all
if (!strpos($file, 'data:image/png;base64,' === false)) {
$file='@'.base64_decode(chunk_split(str_replace(' ', '+', str_replace('data:image/png;base64,', '', $file))));
}
It works, but it's ugly

Maybe you could include this into the phpmyfaq code instead of tcpdf class as I did ? (I would have done it, but don't know where).
What I'm not understanding is attached files to faq are not included in pdf file. I attached a 50kb jpg file to a sample faq article, and it doesn't get included into the pdf (with or without my modification to the code).
Any idea why ?
Re: Passwortschutz auf Verzieichnis /faq
Hi,
I will do some testing on this, thanks a lot for the hint.
bye
Thorsten
I will do some testing on this, thanks a lot for the hint.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Re: Passwortschutz auf Verzieichnis /faq
Hi,
I added this code for phpMyFAQ 2.8.0-RC2:
https://github.com/thorsten/phpMyFAQ/co ... d4a1981021
Please check it.
Attached images are not display in PDF exports, only embedded images. If you need that, please add a feature request here: https://github.com/thorsten/phpMyFAQ/issues
Thanks!
bye
Thorsten
I added this code for phpMyFAQ 2.8.0-RC2:
https://github.com/thorsten/phpMyFAQ/co ... d4a1981021
Please check it.
Attached images are not display in PDF exports, only embedded images. If you need that, please add a feature request here: https://github.com/thorsten/phpMyFAQ/issues
Thanks!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist