generating PDF using TCPDF - cannot extract embedded font - php

I'm using TCPDF for generating dynamic PDFs. It works fine but since I move my generator to a new server I have a problem.
I'm getting a error when I open the pdf:
Cannot extract the embedded font 'AAAAAC+FreeSerif'. Some characters may not display or print correctly.
It displays symbols instead of text. On the old server the files are successfully generated but on the new server all I see are symbols. Anyone has any idea why this would happen? (the files on both servers are the same!).

Figured it out... the problem was that the servers php.ini had:
set_magic_quotes_runtime on
Which corrupted the binary data. Turning it off solved the problem.

Related

FPDF error: Unable to find "startxref" keyword

I have an app that renders PDFs with FPDF.
It was working fine and for some reasons I had to change the PDF files and now I get this error:
Unable to find "startxref" keyword
If I restore the original files, the same error happens.
How do I fix this error?
You simply have to pass a local path instead of an URI to setSourceFile().
The problems lies (sometimes) in the pdf compression.
If you are using linux you can use this to uncompress the pdf:
podofouncompress compressed.pdf decompressed.pdf
I faced this problem recently. I'm using TCPDF to merge uploaded pdf files.
Curiousilly something went wrong when importing some pdf files. Some cases, following error was printed:
Unable to find "startxref" keyword. in pdf_parser->_findXref()
So I tried to solve by reopen these pdfs files in Google Chrome and save it as PDF again. For my surprise, TCPDF worked! I still dont know how it can be but now I got a temporary solution.

Why does outputting a .rtf file with PHP result in a css file error?

I have the same problem to here, but still not found an answer
Php export rtf include css files
and
http://www.zhgzw.com/524809/codep1/php-export-rtf-include-css-files.
I have PHP code that file_get_contents on an existing RTF file, does some str_replace on known phrases in the RTF document and replaces them with PHP variables. I then output it back out for the user to download the file.
I find that the problem is intermittent, but when it does happen, the error message has to be clicked multiple times. All the users on this system use Internet Explorer
The error I get is:
Problem During Load
Problems came up in the following areas during load:
Missing file: ..Windows\Temporary Internet Files\Content.IE5UXO0RLDK\style.css
Missing file: ..Windows\Temporary Internet Files\Content.IE5UXO0RLDK\css/pikaday.css

create a .doc / pdf / odt using codeigniter and php

I followed this tut :
http://klewos.wordpress.com/2010/04/16/using-php-to-fill-a-word-document-quick-tip/
and all is fine till i open the downloaded .doc into libre office,
instead of outputing the doc content, it shows the full xml code as content !
Just note that i would prefer to create a PDF as final document but it seems easier with doc
I should miss a step with the xml to doc ?
if someone sees a better way to do this kind of thing (my base doc is 10 pages long so i don't really want to create a line by line pdf)
Anyhelp is welcome ;)
The article does mention that particular situation:
I’ve tried to open the Word 2003 XML document in OpenOffice.org 3.1.
Unfortunately, Writer wasn’t fooled by the .doc extension and opened
the document as plain text. Only after changing the document’s
extension to .xml, the editor opened it correctly. So, the documents
are portable after all.

php check before pdf2swf failed copying

i have a problem. I use the pdf2swf tool to convert a pdf so that i can display it on a website.
Most of the PDF`s will be converted.
But today i found a PDF on the site that can`t be displayed because the converting failed.
it throws this message
FATAL PDF disallows copying
i know that it is because of the security settings in the pdf.
But i want to know if it is possible to check in php if the pdf has such an restriction.
So that i can show a message if the pdf can`t be converted.
thanks
EDIT: i found the solution for the problem.. the pdf`s was protected from copying so that pdf2swf didn't have the permissions to copy or manipulate the pdf.. just as information if someone else have the same problem

mpdf generates pdf without images

I use mpdf for a php project but I am having difficulties generating pdf file with images. it displays the pdf file correctly on browsers but after I save the pdf file it doesnt display the images. I tried it with different browsers/OS and the result is little bit strange to me. it works on very browser and displays local pdf file correctly on linux machine. mac and windows it displays images on every browser but when I save the pdf file it doesnt display the images on local pdf. do you have any idea how to solve this problem.
Thanks
you have to use absolute linking, starting all the way at the top with the domain name.

Categories