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

@@ -24,81 +24,80 @@
package gnu.jpdf;
/**
* <p>This class is used to hold the xref information in the PDF
* Trailer block.</p>
* <p>
* This class is used to hold the xref information in the PDF Trailer block.</p>
*
* <p>Basically, each object has an id, and an offset in the end file.</p>
* <p>
* Basically, each object has an id, and an offset in the end file.</p>
*
* <p>See the Adobe PDF Manual for more information. This class will
* normally not be used directly by a developer</p>
* <p>
* See the Adobe PDF Manual for more information. This class will normally not
* be used directly by a developer</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 PDFXref
{
public class PDFXref {
/*
/*
* NOTE: Originally an inner class in PDF.java (now PDFDocument) written
* by Peter Mount for uk.org.retep.pdf
*/
*/
/**
* The id of a PDF Object
*/
public int id;
/**
* The id of a PDF Object
*/
public int id;
/**
* The offset within the PDF file
*/
public int offset;
/**
* The offset within the PDF file
*/
public int offset;
/**
* The generation of the object, usually 0
*/
public int generation;
/**
* Creates a crossreference for a PDF Object
* @param id The object's ID
* @param offset The object's position in the file
*/
public PDFXref(int id,int offset)
{
this(id,offset,0);
}
/**
* Creates a crossreference for a PDF Object
*
* @param id The object's ID
* @param offset The object's position in the file
* @param generation The object's generation, usually 0
*/
public PDFXref(int id,int offset,int generation)
{
this.id = id;
this.offset = offset;
this.generation = generation;
}
/**
* @return The xref in the format of the xref section in the PDF file
*/
public String toString()
{
String of = Integer.toString(offset);
String ge = Integer.toString(generation);
String rs = "0000000000".substring(0, 10-of.length()) +
of +
" " +
"00000".substring(0,5-ge.length())+ge;
if(generation==65535)
return rs+" f ";
return rs+" n ";
}
/**
* The generation of the object, usually 0
*/
public int generation;
/**
* Creates a crossreference for a PDF Object
*
* @param id The object's ID
* @param offset The object's position in the file
*/
public PDFXref(int id, int offset) {
this(id, offset, 0);
}
/**
* Creates a crossreference for a PDF Object
*
* @param id The object's ID
* @param offset The object's position in the file
* @param generation The object's generation, usually 0
*/
public PDFXref(int id, int offset, int generation) {
this.id = id;
this.offset = offset;
this.generation = generation;
}
/**
* @return The xref in the format of the xref section in the PDF file
*/
public String toString() {
String of = Integer.toString(offset);
String ge = Integer.toString(generation);
String rs = "0000000000".substring(0, 10 - of.length())
+ of
+ " "
+ "00000".substring(0, 5 - ge.length()) + ge;
if (generation == 65535) {
return rs + " f ";
}
return rs + " n ";
}
} // end class PDFXref