Closed divyasreeg closed 7 years ago
What exactly is your intention? Do you want something like header/footer?
When i enter huge data, the data automatically doesnt go to the next page. It is getting overridden on the page 1 itself. So, how do i find the end of page and enter the data into next page. Its not about header/footer; any kind of data.
What do you mean, it doesn't go on the next page, that's exactly what pagination is for. Could you provide some example code?
Actually i am not allowed to share the office code.
Suppose i want to print some data on pdf page . I initialize the contentStream and write the text. If this text is exceeding the page size, it is getting overridden on the 1st page itself. It is not entering the data by creating new page.
Hello.World.docx Suppose this is the data i am trying to enter in a pdf page.The data which is present in the 2nd page is overridden in the 1st page itself in the pdf
Which API are you using, the low level or the layout API? The latter one supports pagination, see https://github.com/ralfstuckert/pdfbox-layout/blob/master/examples/MultiplePages.java
Ok, i will try this and let you know
The wiki will be also very helpful for you.
How can i implement pagination in my project without using your code. May i know which file has the pagination code in your code.
Yes, the wiki is really helpful
I guess the low level API may be what you want, it allows you to operate on the content stream, see https://github.com/ralfstuckert/pdfbox-layout/blob/master/examples/LowLevelText.java
Yes, this is helpful. But pdfbox should have made the text to automatically enter into the following page like in iText.
Also see the wiki on the low level API: https://github.com/ralfstuckert/pdfbox-layout/wiki/Text-API
After you set the maxwidth to a paragraph, you can ask it for its height and calculate the next position. That's how the layout API works.
Oh.. ok i will try that. We used itext earlier. but now we have to use pdf box since its opensource
To be precise: you can always ask the paragraph for its width/height, but usually you want to constrain it by setting the max width.
Is there still some issue left?
No Ralf, I developed the pdf pages perfectly for my project using Boxable.
Only thing is am not able to set the line spacing to 0.5f in table : https://github.com/dhorions/boxable/tree/master/src/main/java/be/quodlibet/boxable
Thanks for the feedback, closing this issue
How to print text dynamically in a new page using pdfbox? How to find the end of the page so that the data is entered automatically into next page.