mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-24 13:54:56 +00:00
gnujpdf reformat
This commit is contained in:
@@ -23,84 +23,85 @@ package gnu.jpdf;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* <p>This class implements the PDF Catalog,
|
||||
* also known as the root node</p>
|
||||
* <p>
|
||||
* This class implements the PDF Catalog, also known as the root node</p>
|
||||
*
|
||||
* @author Peter T. Mount
|
||||
* @author Eric Z. Beard, ericzbeard@hotmail.com
|
||||
* @version $Revision: 1.2 $, $Date: 2007/08/26 18:56:35 $
|
||||
*/
|
||||
public class PDFCatalog extends PDFObject
|
||||
{
|
||||
/**
|
||||
* The pages of the document
|
||||
*/
|
||||
private PDFPageList pdfPageList;
|
||||
|
||||
/**
|
||||
* The outlines of the document
|
||||
*/
|
||||
private PDFOutline outlines;
|
||||
|
||||
/**
|
||||
* The initial page mode
|
||||
*/
|
||||
private int pagemode;
|
||||
|
||||
/**
|
||||
* This constructs a PDF Catalog object
|
||||
*
|
||||
* @param pdfPageList The PDFPageList object that's the root
|
||||
* of the documents page tree
|
||||
* @param pagemode How the document should appear when opened.
|
||||
* Allowed values are USENONE, USEOUTLINES, USETHUMBS or FULLSCREEN.
|
||||
*/
|
||||
public PDFCatalog(PDFPageList pdfPageList,int pagemode) {
|
||||
super("/Catalog");
|
||||
this.pdfPageList = pdfPageList;
|
||||
this.pagemode = pagemode;
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets the root outline object
|
||||
* @param outline The root outline
|
||||
*/
|
||||
protected void setOutline(PDFOutline outline) {
|
||||
this.outlines = outline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
os.write("/Version /1.7\n".getBytes());
|
||||
public class PDFCatalog extends PDFObject {
|
||||
|
||||
// the /Pages object
|
||||
os.write("/Pages ".getBytes());
|
||||
os.write(pdfPageList.toString().getBytes());
|
||||
os.write("\n".getBytes());
|
||||
|
||||
// the Outlines object
|
||||
if(outlines!=null) {
|
||||
//if(outlines.getLast()>-1) {
|
||||
os.write("/Outlines ".getBytes());
|
||||
os.write(outlines.toString().getBytes());
|
||||
os.write("\n".getBytes());
|
||||
//}
|
||||
/**
|
||||
* The pages of the document
|
||||
*/
|
||||
private PDFPageList pdfPageList;
|
||||
|
||||
/**
|
||||
* The outlines of the document
|
||||
*/
|
||||
private PDFOutline outlines;
|
||||
|
||||
/**
|
||||
* The initial page mode
|
||||
*/
|
||||
private int pagemode;
|
||||
|
||||
/**
|
||||
* This constructs a PDF Catalog object
|
||||
*
|
||||
* @param pdfPageList The PDFPageList object that's the root of the
|
||||
* documents page tree
|
||||
* @param pagemode How the document should appear when opened. Allowed
|
||||
* values are USENONE, USEOUTLINES, USETHUMBS or FULLSCREEN.
|
||||
*/
|
||||
public PDFCatalog(PDFPageList pdfPageList, int pagemode) {
|
||||
super("/Catalog");
|
||||
this.pdfPageList = pdfPageList;
|
||||
this.pagemode = pagemode;
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets the root outline object
|
||||
*
|
||||
* @param outline The root outline
|
||||
*/
|
||||
protected void setOutline(PDFOutline outline) {
|
||||
this.outlines = outline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
os.write("/Version /1.7\n".getBytes());
|
||||
|
||||
// the /Pages object
|
||||
os.write("/Pages ".getBytes());
|
||||
os.write(pdfPageList.toString().getBytes());
|
||||
os.write("\n".getBytes());
|
||||
|
||||
// the Outlines object
|
||||
if (outlines != null) {
|
||||
//if(outlines.getLast()>-1) {
|
||||
os.write("/Outlines ".getBytes());
|
||||
os.write(outlines.toString().getBytes());
|
||||
os.write("\n".getBytes());
|
||||
//}
|
||||
}
|
||||
|
||||
// the /PageMode setting
|
||||
os.write("/PageMode ".getBytes());
|
||||
os.write(PDFDocument.PDF_PAGE_MODES[pagemode].getBytes());
|
||||
os.write("\n".getBytes());
|
||||
|
||||
// finish off with its footer
|
||||
writeEnd(os);
|
||||
}
|
||||
|
||||
// the /PageMode setting
|
||||
os.write("/PageMode ".getBytes());
|
||||
os.write(PDFDocument.PDF_PAGE_MODES[pagemode].getBytes());
|
||||
os.write("\n".getBytes());
|
||||
|
||||
// finish off with its footer
|
||||
writeEnd(os);
|
||||
}
|
||||
} // end class PDFCatalog
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user