Skip to content

Commit b88776b

Browse files
committed
Merged pdfjet
1 parent 534255e commit b88776b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3432
-3367
lines changed

src/main/java/com/pdfjet/A3.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to specify PDF page with size <strong>A3</strong>.
2928
* For more information about the page size classes - A3, A4, A5, B5, Executive, Letter, Legal and Tabloid - see the Page class.

src/main/java/com/pdfjet/A4.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to specify PDF page with size <strong>A4</strong>.
2928
* For more information about the page size classes - A3, A4, A5, B5, Executive, Letter, Legal and Tabloid - see the Page class.

src/main/java/com/pdfjet/A5.java

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to specify PDF page with size <strong>A5</strong>.
2928
* For more information about the page size classes - A3, A4, A5, B5, Executive, Letter, Legal and Tabloid - see the Page class.
@@ -33,4 +32,3 @@ public class A5 {
3332
public static final float[] PORTRAIT = new float[] {420.0f, 595.0f};
3433
public static final float[] LANDSCAPE = new float[] {595.0f, 420.0f};
3534
}
36-

src/main/java/com/pdfjet/Align.java

-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to specify the text alignment in paragraphs.
2928
* See the Paragraph class for more details.
30-
*
3129
*/
3230
public class Align {
3331
public static final int LEFT = 0x00000000;

src/main/java/com/pdfjet/Annotation.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,24 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to create PDF annotation objects.
2928
*
30-
*
3129
*/
3230
class Annotation {
33-
3431
protected int objNumber;
3532
protected String uri;
3633
protected String key;
3734
protected float x1;
3835
protected float y1;
3936
protected float x2;
4037
protected float y2;
41-
4238
protected String language = null;
4339
protected String actualText = null;
4440
protected String altDescription = null;
45-
41+
protected String contents = "TODO";
4642
protected FileAttachment fileAttachment = null;
4743

48-
4944
/**
5045
* This class is used to create annotation objects.
5146
*
@@ -77,5 +72,4 @@ protected Annotation(
7772
this.actualText = (actualText == null) ? uri : actualText;
7873
this.altDescription = (altDescription == null) ? uri : altDescription;
7974
}
80-
8175
}

src/main/java/com/pdfjet/B5.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
/**
2827
* Used to specify PDF page with size <strong>B5</strong>.
2928
* For more information about the page size classes - A3, A4, A5, B5, Executive, Letter, Legal and Tabloid - see the Page class.

src/main/java/com/pdfjet/BMPImage.java

+6-11
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ of this software and associated documentation files (the "Software"), to deal
2323
*/
2424
package com.pdfjet;
2525

26-
2726
import java.io.ByteArrayOutputStream;
2827
import java.util.zip.Deflater;
2928
import java.util.zip.DeflaterOutputStream;
3029

3130
class BMPImage {
32-
3331
int w = 0; // Image width in pixels
3432
int h = 0; // Image height in pixels
3533

@@ -76,8 +74,7 @@ public BMPImage(java.io.InputStream is) throws Exception {
7674
if (offset > 54) {
7775
skipNBytes(is, offset-54);
7876
}
79-
}
80-
else {
77+
} else {
8178
skipNBytes(is, 12);
8279
int numpalcol = readSignedInt(is);
8380
if (numpalcol == 0) {
@@ -87,8 +84,7 @@ public BMPImage(java.io.InputStream is) throws Exception {
8784
parsePalette(is, numpalcol);
8885
}
8986
parseData(is);
90-
}
91-
else {
87+
} else {
9288
throw new Exception("BMP data could not be parsed!");
9389
}
9490

@@ -109,10 +105,11 @@ private void parseData(java.io.InputStream is) throws Exception {
109105
case 4: row = bit4to8(row, w); break; // opslag i palette
110106
case 8: break; // opslag i palette
111107
case 16:
112-
if (r5g6b5)
108+
if (r5g6b5) {
113109
row = bit16to24(row, w); // 5,6,5 bit
114-
else
110+
} else {
115111
row = bit16to24b(row, w);
112+
}
116113
break;
117114
case 24: break; // bytes are correct
118115
case 32: row = bit32to24(row, w); break;
@@ -188,8 +185,7 @@ private static byte[] bit4to8(byte[] row, int width) {
188185
for(int i = 0; i < width; i++) {
189186
if (i % 2 == 0) {
190187
ret[i] =(byte) ((row[i/2] & m11110000)>>4);
191-
}
192-
else {
188+
} else {
193189
ret[i] =(byte) ((row[i/2] & m00001111));
194190
}
195191
}
@@ -268,5 +264,4 @@ public int getHeight() {
268264
public byte[] getData() {
269265
return this.deflated;
270266
}
271-
272267
}

0 commit comments

Comments
 (0)