Coder Social home page Coder Social logo

Comments (8)

maechler avatar maechler commented on May 30, 2024 1

I think @macjohnny is proposing a feature similar to this:

<pdf:document>
   <pdf:header>
       <pdf:text>Some headline text: {yourVariable}</pdf:text>
   </pdf:header>
   <pdf:footer>
       <pdf:text>Footer, we are on page {currentPage}</pdf:text>
   </pdf:footer>
   <pdf:page>
       <pdf:header>Maybe we can overwrite header and footer on pages?</pdf:header>
   </pdf:page>
</pdf:document>

It should be possible to define header and footer on document level. Probably there should also be the possibility to overwrite header and footer on page level and variables like {currentPage} should be provided. In this scenario you could use dynamic data from your model.
I am not sure however how this feature could be implemented. Maybe it is possible to store a reference to e.g. HeaderViewHelper and then render its children on each page with a new set of variables like {currentPage}.

from pdfviewhelpers.

Gernott avatar Gernott commented on May 30, 2024 1

That would be great! I would sponsor €100 for something like this.

from pdfviewhelpers.

maechler avatar maechler commented on May 30, 2024 1

I started progress on this one and created a working example: bb942c3
https://github.com/bithost-gmbh/pdfviewhelpers/tree/feature/headerFooterSupport

It seems to be easier than expected, although it still needs some effort until it is ready to be used.

from pdfviewhelpers.

maechler avatar maechler commented on May 30, 2024 1

@Gernott I just released pdfviewhelpers v2, it contains header and footer ViewHelpers and lots of other features. If you still feel like sponsoring, a contribution would be very welcome!
See https://github.com/bithost-gmbh/pdfviewhelpers#support-development

from pdfviewhelpers.

macjohnny avatar macjohnny commented on May 30, 2024

Currently, it is necessary to extend the class defined in plugin.tx_pdfviewhelpers.settings.config.class, overwrite the Header() or Footer() method or both and set the custom class in plugin.tx_pdfviewhelpers.settings.config.class

The Header() and Footer() methods are called for every new page added.

from pdfviewhelpers.

macjohnny avatar macjohnny commented on May 30, 2024

See the example in https://github.com/bithost-gmbh/pdfviewhelpers/blob/master/Classes/Model/BithostTCPDF.php#L42

from pdfviewhelpers.

PeterSchuhmann avatar PeterSchuhmann commented on May 30, 2024

I think this solution only works if you have a static header and footer. but what if you want to add dynamic data like data from your model?

from pdfviewhelpers.

maechler avatar maechler commented on May 30, 2024

This is implemented and tested in the current develop branch and will be released as part of pdfviewhelpers v2.

from pdfviewhelpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.