Git Product home page Git Product logo

Comments (7)

MarcinZiabek avatar MarcinZiabek commented on May 12, 2024

It is difficult to provide the available size because of the dynamic nature of documents. I am not sure what exactly you are trying to accomplish. As far as I understand, you may want to make a try with the ExtendVerical element 😀

from questpdf.

JSR33 avatar JSR33 commented on May 12, 2024

It doesn't solve my all problem.
In a relative column it actually work pretty well but when have a grid inside of a relative column it doesn't divide the rows for all the space that I have in the column.
I'd love to attach an image but, don't know why, I'm not able to do it.

from questpdf.

JSR33 avatar JSR33 commented on May 12, 2024

Meanwhile I can do a workaround and set the header and footer heigh to a fixed size and that way I always know the free space that I have.

from questpdf.

MarcinZiabek avatar MarcinZiabek commented on May 12, 2024

In a relative column it actually work pretty well but when have a grid inside of a relative column it doesn't divide the rows for all the space that I have in the column.
I'd love to attach an image but, don't know why, I'm not able to do it.

As far as I know, posting an image is simple: just copy the file and paste it into the text. It should be uploaded automatically and attached as markdown 😀

Meanwhile I can do a workaround and set the header and footer heigh to a fixed size and that way I always know the free space that I have.

I expect that in the future, the DynamicComponent will help you with more complex/custom layouts. The development is discussed here. Unfortunately, this is still in the experimental phase as relies on other architectural concepts that are not stable enough to make them public.

from questpdf.

JSR33 avatar JSR33 commented on May 12, 2024

As far as I know, posting an image is simple: just copy the file and paste it into the text. It should be uploaded automatically and attached as markdown 😀

I know :D But is always returning an error when it try to upload the image.

I expect that in the future, the DynamicComponent will help you with more complex/custom layouts. The development is discussed here. Unfortunately, this is still in the experimental phase as relies on other architectural concepts that are not stable enough to make them public.

Ok, no problem. You can close this issue and I'll be looking for future improvements on this.
Btw, congratulations. Excellent job with the library!

from questpdf.

MarcinZiabek avatar MarcinZiabek commented on May 12, 2024

Ok, no problem. You can close this issue and I'll be looking for future improvements on this.

Or please describe your needs more precisely. So even I can understand 😁

from questpdf.

JSR33 avatar JSR33 commented on May 12, 2024

Ok , I'll try to explain it better :p

So, I'm trying to add a complex grid where in the first column I have two rows and in the second column I have only one row.
Example:

       `foreach (var groupedSection in groupedSections)
            {
                var nrColumnsUsed = groupedSection.First().NrColumns;

                if (groupedSection.Count() > 1)
                {
                    row.RelativeColumn(nrColumnsUsed)
                        .Grid(grid =>
                        {
                            foreach (var pageSection in groupedSection.OrderBy(a => a.RowNr))
                            {
                                grid.Columns(nrColumnsUsed);
                                grid.Item(nrColumnsUsed)
                                    .Height(((float)pageSection.HeightPercentage / 100) * pageHeight)
                                    .AlignMiddle()
                                    .AlignCenter()
                                    .Stack(columnStack => { ComposePageElements(columnStack, pageSection.PageElements); });
                            }
                        });
                }
                else
                {
                    row.RelativeColumn(nrColumnsUsed)
                        .Height(pageHeight)
                        .AlignMiddle()
                        .AlignCenter()
                        .Stack(columnStack => { ComposePageElements(columnStack, groupedSection.First().PageElements); });
                }
            }`

In the first column (the one that have 2 rows) I want to use percentages (this calculation could be made from my side) to define the height of each row in the column.

from questpdf.

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.