Hi, I needed some more advanced parsing of the fields because how my pdftemplate was produced. The normal token was not enough.

I did not find anyway to alter the fields before sending data to pdf generation so I added an alter hook that i then could call in my custom module.

Comments

freakalis’s picture

StatusFileSize
new747 bytes

Added a new patch that removed a typo.

wizonesolutions’s picture

There is the Transform Values feature, but I'll definitely review and commit this when I get a chance. Fill PDF needs more hooks. Then I might be able to rewrite the Transform Values feature to use this hook...although that might happen later, as it looks like this hook would only work at the PDF level but not the individual field level (without another hook).

Thanks for contributing!

wizonesolutions’s picture

Status: Needs review » Fixed
StatusFileSize
new727 bytes

This has been edited a bit; I changed the alter hook name. 'fillpdf_fields' was too broad since that might be used in the future for something more generic to do with fields.

I've attributed the patch to you. Thanks again!

wizonesolutions’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Whoops, need to backport this to 6.x too.

wizonesolutions’s picture

Tagging.

wizonesolutions’s picture

Camp is over.

freakalis’s picture

StatusFileSize
new980 bytes

This patch stil haven't been commited into 6.x-1.x-dev.

In a new project of mine I needed to be able to also alter image_data. Because hook_alter only can take one argument as a reference i created a new variable called $data and included both $fields and $image_data.

Maybe there is a nicer way to do this, but it works.

freakalis’s picture

StatusFileSize
new988 bytes

New patch applied to latest dev

  • Commit fb1b69b on 7.x-1.x, 7.x-2.x, 7.x-2.x-tests1, 7.x-1.x-ubercartbackporttest authored by freakalis, committed by wizonesolutions:
    Issue #1336458: Provide alter hook before generation.
    
    

liam morland’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Closed (fixed)

Drupal 6 is no longer supported.