Hi. Sorry for my english.
My images delivered by image_cache module.
The following Code trows an PDF-Error. On Line 52.
modules/print/print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc
Example:
$html='<img src="http://www.example.com/sites/default/files/123456.jpeg?itok=LdD-FdVG">';
Line 52: $pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?{$base_url}[^>]*?)(?:%3F|\?)[\w=&]+([^>]*?>)!is";
Line 53: $html = preg_replace($pattern, '$1$2', $html);
Result: <img src="http://www.example.com/sites/default/files/123456.jpeg-FdVG">
At the End: 123456.jpeg-FdVG
Can you change the RegEx to del the "-" also.
Thx
Comments
Comment #1
dscutaru commented$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?{$base_url}[^>]*?)(?:%3F|\?)[\w=\-&]+([^>]*?>)!is";works for me([\w=&] is replaced with [\w=\-&]), also it works(for me) after commenting out line 53
Comment #2
jcnventuraLet's try an even better pattern [^\s'\"] instead.
http://drupalcode.org/project/print.git/commit/9b403a5
Comment #4
daulet2030 commentedCan you also add for mpdf library inside print_pdf_mpdf.pages.inc?