Giter VIP home page Giter VIP logo

Comments (11)

Ziv-Barber avatar Ziv-Barber commented on June 22, 2024 1

Implemented for version 0.4.2 (only in Github, soon also for npm after finishing to implement more features).
As for page numbers (and more field objects), coming soon.

from officegen.

Ziv-Barber avatar Ziv-Barber commented on June 22, 2024

I started to investigate it back then.

On Fri, Feb 20, 2015 at 1:27 AM, Jeff Fairley [email protected]
wrote:

It would be great to build headers and footers into a word document. It
looks like the xml syntax is the same if not restricted, except there's
"header1.xml" and "footer1.xml" in addition to "document.xml". Thoughts?


Reply to this email directly or view it on GitHub
#52.

from officegen.

jfairley avatar jfairley commented on June 22, 2024

I have a change in progress, though admittedly, I chose to omit the options for now.

I'm on the fence on one issue. In a footer there's typically something left-aligned and something right-aligned (and sometimes something center-aligned). I didn't see how to do that with the existing patterns you've implemented, so I was considering building in three functions -- one to take left-aligned text, one to take centered text, and one to take right-aligned text.

Maybe something like this.

        var report = officegen({
            type: 'docx',
            title: 'Delivery Schedule'
        });

        report.getHeader().setTextLeft('header-left');
        report.getHeader().setTextCenter('header-center');
        report.getHeader().setTextRight('header-right');

        report.getFooter().setTextLeft('left');
        report.getFooter().setTextCenter('center');
        report.getFooter().setTextRight('right');

What are your thoughts on this?

from officegen.

Ziv-Barber avatar Ziv-Barber commented on June 22, 2024

Yes, sounds like a good plan.

On Tue, Feb 24, 2015 at 11:13 PM, Jeff Fairley [email protected]
wrote:

I have a change in progress, though admittedly, I chose to omit the
options for now.

I'm on the fence on one issue. In a footer there's typically something
left-aligned and something right-aligned (and sometimes something
center-aligned). I didn't see how to do that with the existing patterns
you've implemented, so I was considering building in three functions -- one
to take left-aligned text, one to take centered text, and one to take
right-aligned text.

Maybe something like this.

    var report = officegen({
        type: 'docx',
        title: 'Delivery Schedule'
    });

    report.getHeader().setTextLeft('header-left');
    report.getHeader().setTextCenter('header-center');
    report.getHeader().setTextRight('header-right');

    report.getFooter().setTextLeft('left');
    report.getFooter().setTextCenter('center');
    report.getFooter().setTextRight('right');

What are your thoughts on this?


Reply to this email directly or view it on GitHub
#52 (comment).

from officegen.

jfairley avatar jfairley commented on June 22, 2024

Sorry for the delay. Just letting you know this is still on my task list. I had an issue with spacing, then got pulled away to another issue. Definitely gonna come back to finish this thought.

from officegen.

nanthak avatar nanthak commented on June 22, 2024

i can't use headers in docx as jfairley said. In my project i have to generate a report which may be in pdf or word. I have done with pdf. but not on word(docx). I need to done generating docx file that should contains,
1.header with logo img on the top right corner.
2. in the body of docx, have to generate a html table with external css. The content of the html is varied depends on the user selection from client side.
3. Footer with page number.

Need your help to do this. Hope you will...

Thanks..

from officegen.

nanthak avatar nanthak commented on June 22, 2024

Hi jfairley,

Can you please place your code here to know more about this. I'm interested in your way of building headers and footers. Please, do let me know once you completed this module. I'm looking out for your release.

from officegen.

jfairley avatar jfairley commented on June 22, 2024

@Ziv-Barber. I said I would finish this, and I never got around to it. Sorry. I put what I have in PR: #67. It definitely works, but my attempts to build in alignment gutters wasn't coming out right. (Everything comes out left-aligned for me.)

@nanthak, I hope it is helpful for you.

from officegen.

nanthak avatar nanthak commented on June 22, 2024

Thank you jfairley. You have a done a great job. I have one more issue is that i can't create a table with this. even i have a addCell() method, my table won't be appeared properly. I will show my output in the following image.
screenshot from 2015-07-01 13 10 25

from officegen.

jchabot86 avatar jchabot86 commented on June 22, 2024

so is this feature available if i install from npm?

from officegen.

Ziv-Barber avatar Ziv-Barber commented on June 22, 2024

Header and footer coming soon. I already implemented most of it.

from officegen.

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.