Hot answers tagged

8

Adding config.entities = false; to the ckeditor-config packages/ckeditor/config.js prevent ckeditor from escaping special characters. This avoids the issue with smarty-syntax. But I am not sure if this doesn't produce other problems by not escaping anything... If anybody has experiences with that please post them here. EDIT: In CiviCRM 4.7 ckeditor will be ...


8

Are you using the wkhtmltopdf option in CiviCRM: Administer CiviCRM >> System Settings >> Misc http://d46.demo.civicrm.org/civicrm/admin/setting/misc?reset=1 Its a local binary installation (needs to be done by your system admin), but gives you a lot better performance than the php pdf libraries shipped with CiviCRM


7

If you using CiviMail for sending newsletter than you can view the html snippet that was sent as a email body. To view the html you can go navigate to Mailings >> Scheduled and Send Mailing. Find the mailing/newsletter name you want to convert into PDF and then click on report link besides the name. You will be redirected to CiviMail Report: [Name of ...


6

When I have encountered this previously, I have found that it (oddly) enough is caused by extra space in the template code itself - have you tried, for example, removing all the spaces at the beginning of the line where your reference is located? The spacing is wonderful for easily reading the code, of course, but it causes issues like this in my ...


6

Initially i thought the address are rendered using format defined at Address Settings but i was wrong when i checked the message template. The message template is designed to use address format as Street Address Supplement Address Supplement Address State Abbreviation City Postal Code Country I did some modification to message template so that State ...


6

I don't think it's the encoding it seems that none of the included fonts in dompdf support it. See also https://stackoverflow.com/questions/16384517/dompdf-character-encoding-utf-8. If you look in the vendor/dompdf/dompdf/lib/fonts folder there's a readme about DejaVu, and it says you can get the font from http://code.google.com/p/dompdf and copy it into ...


5

It might depend of the template layout you use or token or... plenty of reasons that the pdf generation can become slow. In general, if you want good performances for pdf generations, install wkhtmltopdf and configure civicrm to use it The way pdf generation works is that civicrm generates an html page first, then convert it to pdf. wkhtmltopdf is a ...


5

Create a new envelope PDF format that corresponds to your printer's settings at Administer CiviCRM » Communications » Print Page (PDF) Formats Create a new mailing template from Mailings menu » Message Templates. Fill in the template with the appropriate tokens you'd like - and also a return address if applicable. Select the envelope PDF Format that you ...


5

CiviTeacher is right, there is extraneous character, totally unrelated to the image. I am able to consistently recreate the problem in this way: In WYSIWYG mode (CKEditor) Type "text 1", Enter Type "text 2", shift-enter Move insertion point to the beginning of "text 2", and backspace so that you have "text 1text 2" on one line. Shift-enter to separate "text ...


4

I don't think it's possible right now without coding. If you are not afraid of coding, what you could do is something like : add you membership certificate after the content of the receipt (in templates) and add an arbitrary separator between your receipt and the certificate. In my case <!--break-->. use the hook_civicrm_alterMailParams with the ...


4

Tracked this one down. It worked out of the box in 4.4.x, but doesn't in 4.5.x. Not sure whether it was deliberate, but it's pretty easy to 'fix'. Edit templates/CRM/Mailing/Form/InsertTokens.tpl and change: cj.post( dataUrl, {tid: val}, function( data ) { if ( !isPDF ) { if (prefix == "SMS") { text_message = "sms_text_message"; ...


4

Try: <div style="page-break-before:always;"></div> Works for us, using wkhtmltopdf rather than the default.


4

The issue isn't 100% clear because your formatting doesn't allow me to perfectly understand which tokens have a line break after them and which have a space - but I'm pretty sure I know what's going on. By default, if a token evaluates to NULL and there is NOTHING else on that line, the line will be omitted entirely when producing address labels. However, ...


4

Download the compiled binaries for your system from http://wkhtmltopdf.org/downloads.html to your server and extract to somewhere convenient. The files need to be readable by the account running the webserver. Then go to Administer >> System Settings >> Misc and enter the path to the wkhtmltopdf.


4

That error is coming from dompdf, bundled with CiviCRM. Here are a couple of references to that error outside of CiviCRM: https://github.com/dompdf/dompdf/issues/902 https://github.com/barryvdh/laravel-dompdf/issues/389 The error happens for both 4.6 and 4.7, different php, so the trigger to the issue appears to be somewhat removed. I fixed one case ...


4

The invoice is generated based on the template "Contributions - Invoice". It contains a line to the logo ({$resourceBase}/i/civi99.png" height = "34px" width = "99px") that you would need to replace. You can find teh message templates by Navigating to >>Administer >>CiviMail >>Message Templates in the tab "System Workflow Messages"


4

DOMPDF in CiviCRM have a trouble with special characters UTF-8. We have this same problem in Poland. I've create a repo with solution: https://github.com/ngo360/civicrm.dompdf.utf8 For apply this change go to path: path/to/civicrm/vendor/dompdf and delete all files. Then upload files from repo. I think is resolve Your problem.


3

The only thing that comes to mind is to write an extension to do this. The only way to do it "out of the box" would be to utilize the Print PDF Letter option and utilize a template that would size to an envelope.


3

I figured it out on my own. To print <div> on different pages, it needs to be positioned relative. So, I ended up putting all the existing <div> with position absolute into a <div> with position relative. However, that is not sufficient enough, I also needed to fill in a simple <br /> tag as well. This worked: <div id="page" ...


3

You're right this is a bug. I've filed issue CRM-16596 with a PR to fix it in the next release (4.6.4).


3

Go to Administer > CiviCase > Case Types and add "Print PDF Letter" as an allowed activity to your case type. You will then be able to create a PDF directly from the "Manage Case" screen.


3

Please try removing the space (coded %20) from the filename of the image, either by renaming it on the server or reuploading it.


3

Apologies. This is a Drupal answer and I know you are on Wordpress, but this ticket might attract drupal users too so thought I would outline the approach. There is a View you can download here which provides the logged in user a block with their Membership status etc, and this could be modified to include other fields including image. Using the Print module,...


3

I imagine the ideal solution would be to sniff out the reason there's content in the output buffer when there shouldn't be. That's not what I did. Knowing very little about PHP, I looked up functions pertaining to the output buffer, then added ob_clean(); right after the author/version comments in tcpdf.php ... that's the only change I had to make. ...


3

Turns out that there is an additional setting on CiviContribute Component Settings that appears to override the Misc System Settings which only becomes apparent when you turn on tax/invoicing. (/civicrm/admin/setting/preferences/contribute?reset=1) "Automatically email invoice when user purchases online" This is somewhat confusing. Perhaps we should ...


3

Fonts for TCPDF are generated, and are located in civicrm/vendor/tecnickcom/tcpdf/fonts/ in a format like this: -rw-r--r-- 1 www-data www-data 1,9K Aug 9 14:44 robotoi.ctg.z -rw-r--r-- 1 www-data www-data 8,6K Aug 9 14:44 robotoi.php -rw-r--r-- 1 www-data www-data 78K Aug 9 14:44 robotoi.z To generate the fonts, a static method from the library ...


3

I ended up hardcoding it so it uses $contact['email'] instead of $params['to_email'] I am leaving it open for some time, if anybody has a better idea (or if I missed something obvious) UPDATE: The developers of the extension included this feature. Using version 2.0 the PDF will be emailed to the associated contact if the to email field is left empty. So ...


2

I have implemented membership cards, however on a custom basis. This has been from the back office side of things. Your specification of a member printing their own card is intriguing, though that too would be a bit of custom code. Regardless of who prints it, CiviCRM has nice abilities to generate PDF's from custom code so pretty much whatever format you ...


2

Try using the attachment api, it will handle the nitty-gritty for you.


2

The problem is that the standard is to have addresses all-caps, without punctuation, and with various standard abbreviations. Some clients have asked us if we could "fix" them in bulk to be mixed case, but I point out that the standardization will simply restore the all-caps the next time someone saves the address. Two options: You can use Smarty to ...


Only top voted, non community-wiki answers of a minimum length are eligible