Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docx output #138

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

plutext
Copy link

@plutext plutext commented Jan 30, 2018

This pull request is to see whether there is interest in adding docx output to flying saucer?

By way of background, docx4j has provided XHTML to docx conversion based on a re-packaged flying saucer from late 2011. XHTML to docx seems to be a fairly common requirement.

(I re-packaged FS back then when FS was dormant, and hadn't gotten around to seeing whether there was appetite for including docx capability in FS-proper. YellowfinBI then did the work to re-integrate it in FS, which has made this pull request possible).

If there is enthusiasm for XHTML to docx as part of FS, I'd be happy to help clean up this pull request a bit.

To actually convert XHTML to docx, you'd use https://github.com/plutext/docx4j-ImportXHTML/tree/FS2018 which has FS (and docx4j) as a dependency: https://github.com/plutext/docx4j-ImportXHTML/blob/FS2018/pom.xml#L298

docx4j-ImportXHTML's codebase could also be moved here (flying-saucer-docx) if that were necessary/desirable.

Looking forward to discussion/feedback, thanks! .. Jason

@asturio
Copy link

asturio commented Jan 30, 2018

It's an interesting Frontend feature.

@Lozic
Copy link

Lozic commented Jan 31, 2018

Great!
Would it be easy to adapt to produce xlsx and pptx?

@plutext
Copy link
Author

plutext commented Jan 31, 2018

pptx: there is already some proof of concept level code at https://github.com/plutext/docx4j-ImportXHTML/tree/master/src/main/java/org/pptx4j/convert/in/xhtml which re-uses DocxRenderer

xlsx: https://github.com/alanhay/html-exporter does this, using FS. Not sure how complete it is. Its https://github.com/alanhay/html-exporter/tree/master/src/main/java/uk/co/certait/htmlexporter/writer/excel uses POI (but would be straightforward to port to use docx4j/xlsx4j instead; or there might be value in allowing the user to configure it to use either)

@pbrant
Copy link
Member

pbrant commented Feb 19, 2018

Hey @plutext, this looks super cool! FS is still pretty dormant. I merge bug fixes and do releases as people ask me, but there hasn't really been much active development for a very long time. I do try to be quite conservative as to the changes that go into the existing output targets as befitting the age and stage of the project.

That said, if you'd find it convenient to develop and release this as part of the main repository, that's fine with me. It looks like there are some changes to -core that may cause trouble for other output targets. If you can clean those up (and it's worth your while to do so), I'm happy to merge this, assist with releases, etc.

One other note -- copyright is held by the individual contributor (you or your employer).

@GitMensch
Copy link

@plutext any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants