Home | History | Annotate | Download | only in pdf

Lines Matching defs:Page

35  * open a new document and then for every page you want to add you start a page,
36 * write content to the page, and finish the page. After you are done with all
39 * created one by one, i.e. you can have only a single page to which you are
49 * // crate a page description
52 * // start a page
53 * Page page = document.startPage(pageInfo);
55 * // draw something on the page
57 * content.draw(page.getCanvas());
59 * // finish the page
60 * document.finishPage(page);
87 private Page mCurrentPage;
98 * Starts a page using the provided {@link PageInfo}. After the page
99 * is created you can draw arbitrary content on the page's canvas which
100 * you can get by calling {@link Page#getCanvas()}. After you are done
101 * drawing the content you should finish the page by calling
102 * {@link #finishPage(Page)}. After the page is finished you should
103 * no longer access the page or its canvas.
106 * Also do not call this method if the last page returned by this method
107 * is not finished by calling {@link #finishPage(Page)}.
110 * @param pageInfo The page info. Cannot be null.
111 * @return A blank page.
113 * @see #finishPage(Page)
115 public Page startPage(PageInfo pageInfo) {
119 throw new IllegalArgumentException("page cannot be null");
124 mCurrentPage = new Page(canvas, pageInfo);
129 * Finishes a started page. You should always finish the last started page.
132 * You should not finish the same page more than once.
135 * @param page The page. Cannot be null.
139 public void finishPage(Page page) {
141 if (page == null) {
142 throw new IllegalArgumentException("page cannot be null");
144 if (page != mCurrentPage) {
145 throw new IllegalStateException("invalid page");
147 if (page.isFinished()) {
148 throw new IllegalStateException("page already finished");
150 mPages.add(page.getInfo());
153 page.finish();
161 * Also do not call this method if a page returned by {@link #startPage(
162 * PageInfo)} is not finished by calling {@link #finishPage(Page)}.
192 * <strong>Note:</strong> Do not call this method if the page
194 * calling {@link #finishPage(Page)}.
230 * Throws an exception if the last started page is not finished.
234 throw new IllegalStateException("Current page not finished!");
262 * This class represents meta-data that describes a PDF {@link Page}.
278 * Gets the page width in PostScript points (1/72th of an inch).
280 * @return The page width.
287 * Gets the page height in PostScript points (1/72th of an inch).
289 * @return The page height.
297 * This is the area that contains the page content and is relative to
298 * the page top left.
307 * Gets the page number.
309 * @return The page number.
322 * Creates a new builder with the mandatory page info attributes.
324 * @param pageWidth The page width in PostScript (1/72th of an inch).
325 * @param pageHeight The page height in PostScript (1/72th of an inch).
326 * @param pageNumber The page number.
330 throw new IllegalArgumentException("page width must be positive");
333 throw new IllegalArgumentException("page width must be positive");
345 * This is the area that contains the page content and is relative to
346 * the page top left.
348 * @param contentRect The content rectangle. Must fit in the page.
355 throw new IllegalArgumentException("contentRect does not fit the page");
377 * This class represents a PDF document page. It has associated
381 * a page has
383 public static final class Page {
390 * @param canvas The canvas of the page.
393 private Page(Canvas canvas, PageInfo pageInfo) {
399 * Gets the {@link Canvas} of the page.
426 * @return The canvas if the page is not finished, null otherwise.
428 * @see PdfDocument#finishPage(Page)
435 * Gets the {@link PageInfo} with meta-data for the page.
437 * @return The page info.
439 * @see PdfDocument#finishPage(Page)