I want to use the pdf as a invoicing idea but I’m having some issues with special characters.
For the £ sign I’m getting £ in my document. Is there a reason that the  is showing up and how can I stop that from appearing?
Thanks.
It’s probably a character encoding mismatch.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I’ve gotten that in some cases, and it appears to be an extraneous normally non-displaying formatting character in the original. It’s only happened when a client using Windows edits/creates a document. Making sure my browser matches the site’s character set, I just re-enter the part (usually at the beginning of a paragraph) and it goes away. I suspect somebody is doing copy/paste from Word or something, in spite of repeatedly being told not to do that.
Hi Susan, I’m typing in to the document body and saving and then downloading the PDF. As I said, I type £ and it comes out with that special character in front. I’m guessing that if I add  to be stripped won’t help as it appears to be happening during the PDF creation process.
I don’t have any knowledge of special character encoding either
I just thought it would be a simple fix like escaping the £ sign in the text area of the document for it to display in the PDF lol. I tried £ but that was printed in the PDF as £ rather than £. I will see what I can find on Google.
I just tried the $ symbol and this displays properly...
-
- 2,204 Posts
Ok now this is nice
but the content is not parsed
how can I parse the content so that snippets are parsed and any other tag before its send to the pdf?
I tryed: $modx->parseDocumentSource but that did not parse any snippet calls I had, does anyone has any idea?
I have one one page a ditto call I need that page to be made into a pdf but now it generates the pae with the call instead of the parsed content.
Dimmy
-
- 5,888 Posts
don’t know, if this can work, but you can try:
$fields = 'id,longtitle,description';
.
.
.
.
.
.
$chapter = $page['longtitle'];
$title = $page['description'];
//$content = str_replace($remove, '', $page['content']);
$url = $modx->makeUrl($page['id'], '', '', 'full');
$content = file_get_contents($url);
the template should be without head and so on, of course