Forum


Replies: 5   Views: 2944
Wierd characters in pdf output in firefox
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by davelavinsky  · 21-02-2018 - 17:05

For some odd reason, the characters (when coverted to PDF) show like this.

https://imgur.com/a/LLtcH

FireFox 58.0.2 64-bit - this not happening in Chrome or Safari.

$docx->enableCompatibilityMode();
$docx->createDocx("temp/".$ID);
$docx->transformDocument("temp/$ID.docx", "temp/$ID.pdf");

header('Content-type:application/pdf');
header('Content-Disposition:inline;filename="Plan - '.$bp->Name.'.pdf"');
readfile("temp/$ID.pdf");

 

Posted by admin  · 22-02-2018 - 08:02

Hello,

We recommend you to run the included sample in the package, that transform a DOCX to PDF with text and check the output.

It seems the text your are adding has that weird characters and for any reason we don't know the PDF reader included Firefox show them, but not other PDF readers. The best solution would be cleaning the text you are adding.

Regards.

Posted by davelavinsky  · 03-03-2018 - 14:02

I checked with the PDF file this time downloading it instead of viewing it within the FireFox browser and there were no wierd characters.

So this issue is with only FireFox inline viewer. Is there anything I can do to troubleshoot this ?

header('Content-type:application/pdf');
header('Content-Disposition:attachment;filename="'.$bp->Name.'.pdf"');
# header('Content-Disposition:inline;filename="'.$bp->Name.'.pdf"');

 

Posted by admin  · 04-03-2018 - 09:29

Hello,

It seems the text you are adding has that weird characters and for any reason we don't know the PDF reader included in Firefox show them, but not other PDF readers.

We recommend you to check the DOCX file with a HEX editor to find that characters to be able to clean them. Maybe if you also send the PDF to the Mozilla team they can guess why the inline PDF reader included in Firefox is showing that characters but other PDF readers not.

Regards.

Posted by davelavinsky  · 06-03-2018 - 06:18

Mozilla has confirmed that this is a bug in the current version of Firefox (58) - fixed in version 60.

Thanks

Posted by admin  · 08-03-2018 - 13:06

Hello,

Thanks for posting the information.

Regards.