drmacro / wordinator

Generate high-quality DOCX files using a simplified XML format (simple word processing XML).
Apache License 2.0
37 stars 8 forks source link

Resize images to fit container width #129

Open oleksandr-oboznyi opened 10 months ago

oleksandr-oboznyi commented 10 months ago

BASED ON https://github.com/drmacro/wordinator/pull/128

Resize images to fit container width

ekimbernow commented 1 month ago

Oleksandr--my appologies for not looking at these PRs sooner.

These all look interesting and I'll evaluate them as I can over the next month or so--I can really only work on Wordinator on weekends.

It would also be useful to know what you're using Wordinator for so I can be sure to support you appropriately.

markloughnan commented 1 month ago

Hi Eliot

This came my way from one of our development team members.

We tried hard to get Wordinator to be able to take HTML text and convert it to DOCX, and in turn convert the DOCX to PDF (using LibreOffice). It mostly worked pretty good but we ran into troubles in areas like embedded bullet points and tables. It was also quite slow due to the number of transformations we had to make, as well as invoking both Wordinator and LibreOffice.

The PRs Oleksandr sent you were based on the tweaks we felt we needed.

We are not however going to keep using this library much longer, as we managed to persuade the authors of Pd4ML to update their tool to be able to produce DOCX files (as well as PDF). You can see a little info in this at https://pd4ml.com/products/ This tool works well for our use case and meant we did not need to use XSLT anymore. It seems to handle the DOCX generation well (and quickly) and they are evolving their product. We also do not need to deploy LibreOffice anymore either, which is generally gets a lot of vulnerabilities.

Thanks for your tool – it is good – it just didn’t quite fit our very complex use cases in the end.

Kind regards

Mark Loughnan

ekimbernow commented 1 month ago

Cool—thanks for letting me know.

If your ultimate requirement is to make PDFs from HTML source there are much better ways to do it, including using the Antenna House Formatter product, which has excellent support for CSS paged media (I used it on a project to generate complex PDFs for municipal code) and Syncro Soft’s Chemistry formatter, which implements CSS paged media on top of the open-source FOP renderer. It’s not as full featured as Antenna House Formatter but is I think less expensive.

For example, the Zoomin online delivery system, which ServiceNow uses for our docs.servicenow.com site, uses Antenna House under the covers to generate PDFs on demand from the HTML served to the site.

Cheers,

E.


Eliot Kimber Sr Staff Content Engineer Digital Content & Design O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow

From: markloughnan @.> Date: Wednesday, August 14, 2024 at 9:33 AM To: drmacro/wordinator @.> Cc: Eliot Kimber @.>, Comment @.> Subject: Re: [drmacro/wordinator] Resize images to fit container width (PR #129) [External Email]


Hi Eliot

This came my way from one of our development team members.

We tried hard to get Wordinator to be able to take HTML text and convert it to DOCX, and in turn convert the DOCX to PDF (using LibreOffice). It mostly worked pretty good but we ran into troubles in areas like embedded bullet points and tables. It was also quite slow due to the number of transformations we had to make, as well as invoking both Wordinator and LibreOffice.

The PRs Oleksandr sent you were based on the tweaks we felt we needed.

We are not however going to keep using this library much longer, as we managed to persuade the authors of Pd4ML to update their tool to be able to produce DOCX files (as well as PDF). You can see a little info in this at https://pd4ml.com/products/https://pd4ml.com/products/ This tool works well for our use case and meant we did not need to use XSLT anymore. It seems to handle the DOCX generation well (and quickly) and they are evolving their product. We also do not need to deploy LibreOffice anymore either, which is generally gets a lot of vulnerabilities.

Thanks for your tool – it is good – it just didn’t quite fit our very complex use cases in the end.

Kind regards

Mark Loughnan

— Reply to this email directly, view it on GitHubhttps://github.com/drmacro/wordinator/pull/129#issuecomment-2288954346, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVNTHFXMHTTBTGF64SAHLFTZRNTCPAVCNFSM6AAAAABL7EXSBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBYHE2TIMZUGY. You are receiving this because you commented.Message ID: @.***>