![]() As the CEO of a company that creates tools for building apps for most of Apple’s ecosystem and given Apple’s history of secrecy, I’m understandably curious just how blindsided I might be each June. Some years they introduce something big and new that we were pretty much expecting. I’ve learned over the years not to have any specific expectations from Apple’s WWDC keynote. Ask Javier questions on Twitter at on the Xojo Forum. He lives in Castellón, Spain and hosts regular Xojo hangouts en español. ![]() Javier Menendez is an engineer at Xojo and has been using Xojo since 1998. Open it using your preferred PDF viewer app and you’ll see how the second loop was able to draw again on every one of the pages from the PDF we created. Run this sample snippet of code and you’ll get a PDF on your computer Desktop. Lastly, we save our PDF to a FolderItem.ĭ.Save(("CurrentPage.PDF")) G.DrawText("Page " + i.ToString + " of " + x.ToString, 20, g.Height - 30) that is, the one retrieving the current Graphics context. Here is where we set which will be the current "active" page Remember that the first page in a PDF document starts at 1! we iterate on every page in order to add the footer. Once we create the pages with some content on them, G.DrawText("Some sample text in page #" + n.ToString, 20, 20) Let’s create a 10 page PDF and then add the numbered footer on every page of the document: Var d As New PDFDocument Let’s see how this works through this example. This way, when we assign a new value to the CurrentPage property, it will retrieve the current Graphics context for that page in order to continue adding new content. ![]() The PageCount property gives the total number of pages in the PDF, and the the CurrentPage property (read/write) can be used to reach a given page within a PDF being created. The solution is to use the PageCount and CurrentPage properties in Xojo’s PDFDocument class. So how do you add this new content to your PDFs? And yet, that is necessary, for example, to add a footer reflecting the current page number over the total of pages in the document. When creating a PDF it is not always possible to anticipate how many pages the document will have.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |