gnujpdf reformat

This commit is contained in:
Jindra Petřík
2021-02-20 10:01:49 +01:00
parent 7eb151055b
commit df913281dc
24 changed files with 3587 additions and 3574 deletions

View File

@@ -31,65 +31,64 @@ import java.util.*;
* @author Eric Z. Beard, ericzbeard@hotmail.com
* @version $Revision: 1.2 $, $Date: 2007/08/26 18:56:35 $
*/
public class PDFPageList extends PDFObject
{
/**
* This holds the pages
*/
private Vector<PDFPage> pages;
/**
* This constructs a PDF Pages object.
*/
public PDFPageList() {
super("/Pages");
pages = new Vector<PDFPage>();
}
/**
* This adds a page to the document.
*
* @param page PDFPage to add
*/
public void add(PDFPage page) {
pages.addElement(page);
// Tell the page of ourselves
page.pdfPageList = this;
}
/**
* This returns a specific page. Used by the PDF class.
* @param page page number to return
* @return PDFPage at that position
*/
public PDFPage getPage(int page) {
return (PDFPage)(pages.elementAt(page));
}
/**
* @param os OutputStream to send the object to
* @exception IOException on error
*/
public void write(OutputStream os) throws IOException {
// Write the object header
writeStart(os);
// now the objects body
// the Kids array
os.write("/Kids ".getBytes());
os.write(PDFObject.toArray(pages).getBytes());
os.write("\n".getBytes());
// the number of Kids in this document
os.write("/Count ".getBytes());
os.write(Integer.toString(pages.size()).getBytes());
os.write("\n".getBytes());
// finish off with its footer
writeEnd(os);
}
public class PDFPageList extends PDFObject {
/**
* This holds the pages
*/
private Vector<PDFPage> pages;
/**
* This constructs a PDF Pages object.
*/
public PDFPageList() {
super("/Pages");
pages = new Vector<PDFPage>();
}
/**
* This adds a page to the document.
*
* @param page PDFPage to add
*/
public void add(PDFPage page) {
pages.addElement(page);
// Tell the page of ourselves
page.pdfPageList = this;
}
/**
* This returns a specific page. Used by the PDF class.
*
* @param page page number to return
* @return PDFPage at that position
*/
public PDFPage getPage(int page) {
return (PDFPage) (pages.elementAt(page));
}
/**
* @param os OutputStream to send the object to
* @exception IOException on error
*/
public void write(OutputStream os) throws IOException {
// Write the object header
writeStart(os);
// now the objects body
// the Kids array
os.write("/Kids ".getBytes());
os.write(PDFObject.toArray(pages).getBytes());
os.write("\n".getBytes());
// the number of Kids in this document
os.write("/Count ".getBytes());
os.write(Integer.toString(pages.size()).getBytes());
os.write("\n".getBytes());
// finish off with its footer
writeEnd(os);
}
} // end class PDFPageList