CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • how to put in headers and footers in Templates in 'Print PDF Letter' activity
Pages: [1]

Author Topic: how to put in headers and footers in Templates in 'Print PDF Letter' activity  (Read 1782 times)

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
how to put in headers and footers in Templates in 'Print PDF Letter' activity
June 02, 2011, 05:10:44 am
I have created a message template (unimaginatively called 'standard letter') which I can use in the 'Print PDF Letter' Activity type, which works just fine, ie I can generate a letter in PDF format with the tokens substituted with data for the Contact (postal greeting, address etc).

However, I'd like to include standard headers and footers in the printed letters (to feature logos, boilerplate text, etc), and I have tried using HTML 5 tags <header> and <footer> but they are quite obviously not recognised as such when the PDF is generated.   :(

Does anyone have any suggestions about how this could be achieved (short of getting into PHP programming?)?  ::)

Thanks
Mark

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: how to put in headers and footers in Templates in 'Print PDF Letter' activity
June 03, 2011, 09:19:09 pm
Hi,
Not sure what this has to do with civicase, and not sure really even what you're asking.

Can't you just stick in <img> and other regular html tags at the top and bottom of the template?

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
Re: how to put in headers and footers in Templates in 'Print PDF Letter' activity
June 04, 2011, 12:37:14 am
Well, I tried that but there were two problems.

I put an image at the top of the template but not only could it not be centred but also when the PDF was generated it was generated much larger than it appeared in the template.   >:(

When you say 'the bottom of the template', what exactly do you mean?  ??? When the PDF is generated then I want that piece of content to appear at the foot of the page, regardless of how much text I put in the letter, not just the last thing that appears.   :(

Mark

PS  I agree that this issue is not specific to CiviCase, it should really be in the parent forum, 'Using CiviCRM'.  :-[

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: how to put in headers and footers in Templates in 'Print PDF Letter' activity
June 05, 2011, 10:19:31 am
For the image yes there is a difference in screen resolution and print resolution (dpi). The wysiwyg editor isn't designed for previewing print-layouts, so you'll need to play with the source image's resolution.

And I see now you want a per-page header/footer. I don't know if that's available with the civi message templates currently. You could work around it but it would be awkward, e.g. counting how many lines have been output and inserting it at that point. There might be a css property for per-page header/footer - I'm not familiar enough with css to know if that even exists, never mind whether dompdf recognizes it.

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
Re: how to put in headers and footers in Templates in 'Print PDF Letter' activity
June 14, 2011, 07:50:15 am
I have given up on this issue and told my users that they will just have to print their PDF Letters on pre-printed stationery.
There are some useful improvements in Print PDF Letter in 3.4.2 but none that cover this point at all.  ::)

Mark

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • how to put in headers and footers in Templates in 'Print PDF Letter' activity

This forum was archived on 2017-11-26.