mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-25 09:36:28 +00:00
gnujpdf reformat
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user