christiaanderidder / QuestPDF.Markdown

QuestPDF.Markdown allows rendering markdown into a QuestPDF document
MIT License
29 stars 7 forks source link

Changed from ConstantColumn to RelativeColumn with Fraction #71

Closed liam-silvatech closed 3 months ago

liam-silvatech commented 3 months ago

Markdig col.Width is returning a percentage, this making the constant column that is expecting a point value very small column when rendered. This divides 100 into a fraction of 4 to calculate the relative column.

liam-silvatech commented 3 months ago

Just added support for base64 encoded images, it seems to validate during this aspect of the query.

.Where(l => l.IsImage && l.Url != null && Uri.IsWellFormedUriString(l.Url, UriKind.Absolute))

Therefore just added the decoding and skipped the downloading part of the code.

It is not tidy and might need more thought.

christiaanderidder commented 3 months ago

Hi @liam-silvatech,

I had a look at your proposed changes and decided to go a slightly different route to support column widths for grid tables. These changes have been released in 1.20, please let me know if this solves the issues for you.

Regarding the Base64 images, it would be best to create a separate PR for that.

liam-silvatech commented 3 months ago

@christiaanderidder Thanks for adding this.

It does indeed work.

The other aspect of GridTables I can't get to work is merging cells. If I make a row span multiple columns then that isn't replicated.

I think if we took the examples of GridTables from the extension documentation and got that working that is a good approach for validation.

https://pandoc.org/chunkedhtml-demo/8.9-tables.html

I'm using GridTables as I have a complex document to replicate in markdown and I've got it nearly complete once I can span columns.

The base64 image I'll create a new pull request.

liam-silvatech commented 3 months ago

To be fair I should be using the Markdig examples as validation, as it's not quite the same as pandoc.

https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/GridTableSpecs.md