@@ -62,14 +62,14 @@ public LocalInputSource(String fileAsBase64, String filename) {
6262 this .filename = filename ;
6363 }
6464
65- private PDFInputOperation getPdfInputOperator () {
65+ private PDFInputOperation getPDFInputOperator () {
6666 if (this .pdfInputOperator == null ) {
6767 this .pdfInputOperator = new PDFInputOperator ();
6868 }
6969 return this .pdfInputOperator ;
7070 }
7171
72- private PDFCompression getPdfCompressor () {
72+ private PDFCompression getPDFCompressor () {
7373 if (this .pdfCompressor == null ) {
7474 this .pdfCompressor = new PDFCompressor ();
7575 }
@@ -86,7 +86,7 @@ public int getPageCount() throws IOException {
8686 if (!this .isPDF ()) {
8787 return 1 ;
8888 }
89- return getPdfInputOperator ().getPageCount (this .file );
89+ return getPDFInputOperator ().getPageCount (this .file );
9090 }
9191
9292 /**
@@ -97,7 +97,7 @@ public int getPageCount() throws IOException {
9797 */
9898 public void applyPageOptions (PageOptions pageOptions ) throws IOException {
9999 if (pageOptions != null && this .isPDF ()) {
100- this .file = getPdfInputOperator ().split (this .file , pageOptions ).getFile ();
100+ this .file = getPDFInputOperator ().split (this .file , pageOptions ).getFile ();
101101 }
102102 }
103103
@@ -106,61 +106,52 @@ public void applyPageOptions(PageOptions pageOptions) throws IOException {
106106 */
107107 public boolean isPDF () {
108108 if (this .isPDF == null ) {
109- this .isPDF = getPdfInputOperator ().isPDF (this .file );
109+ this .isPDF = getPDFInputOperator ().isPDF (this .file );
110110 }
111111 return this .isPDF ;
112112 }
113113
114- public LocalInputSource compress (
115- Integer quality ,
114+ public void compress (
115+ int quality ,
116116 Integer maxWidth ,
117117 Integer maxHeight ,
118118 Boolean forceSourceText ,
119119 Boolean disableSourceText
120120 ) throws IOException {
121121 if (isPDF ()) {
122- this .file = getPdfCompressor ()
122+ this .file = getPDFCompressor ()
123123 .compressPDF (this .file , quality , forceSourceText , disableSourceText );
124124 } else {
125125 this .file = ImageCompressor .compressImage (this .file , quality , maxWidth , maxHeight );
126126 }
127- return this ;
128127 }
129128
130- public LocalInputSource compress (
131- Integer quality ,
129+ public void compress (
130+ int quality ,
132131 Integer maxWidth ,
133132 Integer maxHeight ,
134133 Boolean forceSourceText
135134 ) throws IOException {
136- return this .compress (quality , maxWidth , maxHeight , forceSourceText , true );
135+ this .compress (quality , maxWidth , maxHeight , forceSourceText , true );
137136 }
138137
139- public LocalInputSource compress (
138+ public void compress (
140139 int quality ,
141140 boolean forceSourceText ,
142141 boolean disableSourceText
143142 ) throws IOException {
144- return this .compress (quality , null , null , forceSourceText , disableSourceText );
145- }
146-
147- public LocalInputSource compress (
148- Integer quality ,
149- Integer maxWidth ,
150- Integer maxHeight
151- ) throws IOException {
152- return this .compress (quality , maxWidth , maxHeight , false , true );
143+ this .compress (quality , null , null , forceSourceText , disableSourceText );
153144 }
154145
155- public LocalInputSource compress (Integer quality , Integer maxWidth ) throws IOException {
156- return this .compress (quality , maxWidth , null , false , true );
146+ public void compress (int quality , Integer maxWidth , Integer maxHeight ) throws IOException {
147+ this .compress (quality , maxWidth , maxHeight , false , true );
157148 }
158149
159- public LocalInputSource compress (Integer quality ) throws IOException {
160- return this .compress (quality , null , null , false , true );
150+ public void compress (int quality ) throws IOException {
151+ this .compress (quality , null , null , false , true );
161152 }
162153
163- public LocalInputSource compress () throws IOException {
164- return this .compress (85 , null , null , false , true );
154+ public void compress () throws IOException {
155+ this .compress (85 , null , null , false , true );
165156 }
166157}
0 commit comments