-
Notifications
You must be signed in to change notification settings - Fork 22
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
Multi page PDF. #127
Comments
As i see it we have to manually calculate and split our rendering into pdf pages. Again, pdf is just a canvas like a screen canvas would be for a usual rendering so it's up to the developer to organize the UI. 1 Remove any scrolls. You can still use a SkiaLayout with ItemTemplate, just it will take the height it would need. Could go in details in the upcoming days. |
Maybe if you could add an A4 portrait page example in demos that would help a lot of people as this is most demanded page layout used by people. |
I tried the dividing and it is cutting the text too, maybe I will add margins and it might solve it. Edit, it won't as that would be top and bottom margin only, maybe I need to manually handle generating PDF. |
No-no, i mean first you render everything into a fake in-memory canvas, then iterating through pages you render the appropriate part of it to the pdf page. I сould provide an example tomorrow. |
That'd be so helpful, thank you for your amazing work to the community. I had almost moved to Flutter for better solutions to this problem. 😅 I have done it in Swift but that is like my backyard technology and I can keep up with advance tech there but this is new territory to me. |
No probs, been a bit busy again, still on it sorry for delay! |
Please use nuget 1.2.9.2 an do not reference skiasharp 2.88.9 for windows.. had to revert back to 2.88.9-preview.2.2 |
I have updated to 1.2.9.2 on Mac and tried iOS/Android and mac desktop but it does not render the Grid with item template. https://github.com/takasurazeem/AlTanzeel/blob/Generate-Quiz-PDF/AlTanzeel/Pages/QuizReport.xaml |
Also, the PDF still clips the content from the demo application, I think before drawing we should check if the text is clipping then just move to the next page and don't draw the text there, this all has to be programmatically done. |
Thanks for the example, will make it work ok. |
So i added some fixes: takasurazeem/AlTanzeel#3, we have a problem with splitting to pages left, it seems. |
Hmmm, in Swift, when I was generating the PDF, I would check if the text that is to be drawn ends up having y position above the page's length; I would move that entire block to the next page. Working with low-level APIs in Swift was easy for me; they were not that low level but gave me access to what I wanted, but in MAUI and DrawnUI, wouldn't we want to use the same approach? I plan on adding horizontal rules below the Arabic text that gets drawn as it is sort of a quiz thing. Below is my Swift app generated document. |
I see the idea. Can you share the swift code please where you are able to check if you should postpone to next page? Would think on implementing the same stuff here if it's technically possible. |
Specific logic: https://github.com/takasurazeem/QuranMajeed/blob/develop/QuranMajeed/Quiz/PDFPreview/Utility/PDFGenerator.swift#L229-L236 I will see if I can add comments inside the function, function name is |
Hi, I am trying to generate a PDF using DataTemplate and scrollview (CollectionView behavior) and it works, however the generated PDF is just one page instead of multipage. Is there some configuration to let it move to new page when page size exceeds A4 or letter?
The text was updated successfully, but these errors were encountered: