@@ -436,7 +436,7 @@ public PdfCanvas setFontAndSize(PdfFont font, float size) {
436
436
PdfName fontName = resources .addFont (document , font );
437
437
currentGs .setFont (font );
438
438
contentStream .getOutputStream ()
439
- .write (fontName )
439
+ .write (( PdfObject ) fontName )
440
440
.writeSpace ()
441
441
.writeFloat (size ).writeSpace ()
442
442
.writeBytes (Tf );
@@ -1127,7 +1127,7 @@ public PdfCanvas circle(final double x, final double y, final double r) {
1127
1127
public PdfCanvas paintShading (PdfShading shading ) {
1128
1128
PdfName shadingName = resources .addShading (shading );
1129
1129
document .checkIsoConformance (currentGs , IsoKey .GRAPHIC_STATE_ONLY );
1130
- contentStream .getOutputStream ().write (shadingName ).writeSpace ().writeBytes (sh );
1130
+ contentStream .getOutputStream ().write (( PdfObject ) shadingName ).writeSpace ().writeBytes (sh );
1131
1131
return this ;
1132
1132
}
1133
1133
@@ -1431,7 +1431,7 @@ public PdfCanvas setRenderingIntent(PdfName renderingIntent) {
1431
1431
return this ;
1432
1432
currentGs .setRenderingIntent (renderingIntent );
1433
1433
contentStream .getOutputStream ()
1434
- .write (renderingIntent ).writeSpace ()
1434
+ .write (( PdfObject ) renderingIntent ).writeSpace ()
1435
1435
.writeBytes (ri );
1436
1436
return this ;
1437
1437
}
@@ -1533,15 +1533,15 @@ else if (colorSpace instanceof PdfDeviceCs.Rgb)
1533
1533
else if (colorSpace instanceof PdfDeviceCs .Cmyk )
1534
1534
contentStream .getOutputStream ().writeFloats (colorValue ).writeSpace ().writeBytes (fill ? k : K );
1535
1535
else if (colorSpace instanceof PdfSpecialCs .UncoloredTilingPattern )
1536
- contentStream .getOutputStream ().write (resources .addColorSpace (colorSpace )).writeSpace ().writeBytes (fill ? cs : CS ).
1537
- writeNewLine ().writeFloats (colorValue ).writeSpace ().write (resources .addPattern (pattern )).writeSpace ().writeBytes (fill ? scn : SCN );
1536
+ contentStream .getOutputStream ().write (( PdfObject ) resources .addColorSpace (colorSpace )).writeSpace ().writeBytes (fill ? cs : CS ).
1537
+ writeNewLine ().writeFloats (colorValue ).writeSpace ().write (( PdfObject ) resources .addPattern (pattern )).writeSpace ().writeBytes (fill ? scn : SCN );
1538
1538
else if (colorSpace instanceof PdfSpecialCs .Pattern )
1539
- contentStream .getOutputStream ().write (PdfName .Pattern ).writeSpace ().writeBytes (fill ? cs : CS ).
1540
- writeNewLine ().write (resources .addPattern (pattern )).writeSpace ().writeBytes (fill ? scn : SCN );
1539
+ contentStream .getOutputStream ().write (( PdfObject ) PdfName .Pattern ).writeSpace ().writeBytes (fill ? cs : CS ).
1540
+ writeNewLine ().write (( PdfObject ) resources .addPattern (pattern )).writeSpace ().writeBytes (fill ? scn : SCN );
1541
1541
else if (colorSpace .getPdfObject ().isIndirect ()) {
1542
1542
if (!setColorValueOnly ) {
1543
1543
PdfName name = resources .addColorSpace (colorSpace );
1544
- contentStream .getOutputStream ().write (name ).writeSpace ().writeBytes (fill ? cs : CS );
1544
+ contentStream .getOutputStream ().write (( PdfObject ) name ).writeSpace ().writeBytes (fill ? cs : CS );
1545
1545
}
1546
1546
contentStream .getOutputStream ().writeFloats (colorValue ).writeSpace ().writeBytes (fill ? scn : SCN );
1547
1547
}
@@ -1992,7 +1992,7 @@ public PdfCanvas setExtGState(PdfExtGState extGState) {
1992
1992
if (!extGState .isFlushed ())
1993
1993
currentGs .updateFromExtGState (extGState );
1994
1994
PdfName name = resources .addExtGState (extGState );
1995
- contentStream .getOutputStream ().write (name ).writeSpace ().writeBytes (gs );
1995
+ contentStream .getOutputStream ().write (( PdfObject ) name ).writeSpace ().writeBytes (gs );
1996
1996
return this ;
1997
1997
}
1998
1998
@@ -2027,13 +2027,13 @@ public PdfCanvas beginMarkedContent(PdfName tag) {
2027
2027
*/
2028
2028
public PdfCanvas beginMarkedContent (PdfName tag , PdfDictionary properties ) {
2029
2029
mcDepth ++;
2030
- PdfOutputStream out = contentStream .getOutputStream ().write (tag ).writeSpace ();
2030
+ PdfOutputStream out = contentStream .getOutputStream ().write (( PdfObject ) tag ).writeSpace ();
2031
2031
if (properties == null ) {
2032
2032
out .writeBytes (BMC );
2033
2033
} else if (properties .getIndirectReference () == null ) {
2034
2034
out .write (properties ).writeSpace ().writeBytes (BDC );
2035
2035
} else {
2036
- out .write (resources .addProperties (properties )).writeSpace ().writeBytes (BDC );
2036
+ out .write (( PdfObject ) resources .addProperties (properties )).writeSpace ().writeBytes (BDC );
2037
2037
}
2038
2038
return this ;
2039
2039
}
@@ -2142,7 +2142,6 @@ public PdfStream getContentStream() {
2142
2142
* @param d an element of the transformation matrix
2143
2143
* @param e an element of the transformation matrix
2144
2144
* @param f an element of the transformation matrix
2145
- * @on error
2146
2145
*/
2147
2146
protected void addInlineImage (PdfImageXObject imageXObject , float a , float b , float c , float d , float e , float f ) {
2148
2147
document .checkIsoConformance (imageXObject .getPdfObject (), IsoKey .INLINE_IMAGE , resources );
@@ -2153,7 +2152,7 @@ protected void addInlineImage(PdfImageXObject imageXObject, float a, float b, fl
2153
2152
for (Map .Entry <PdfName , PdfObject > entry : imageXObject .getPdfObject ().entrySet ()) {
2154
2153
PdfName key = entry .getKey ();
2155
2154
if (!PdfName .Type .equals (key ) && !PdfName .Subtype .equals (key ) && !PdfName .Length .equals (key )) {
2156
- os .write (entry .getKey ()).writeSpace ();
2155
+ os .write (( PdfObject ) entry .getKey ()).writeSpace ();
2157
2156
os .write (entry .getValue ()).writeNewLine ();
2158
2157
}
2159
2158
}
@@ -2173,13 +2172,12 @@ protected void addInlineImage(PdfImageXObject imageXObject, float a, float b, fl
2173
2172
* @param e an element of the transformation matrix
2174
2173
* @param f an element of the transformation matrix
2175
2174
* @return current canvas.
2176
- * @on error
2177
2175
*/
2178
2176
private PdfCanvas addForm (PdfFormXObject form , float a , float b , float c , float d , float e , float f ) {
2179
2177
saveState ();
2180
2178
concatMatrix (a , b , c , d , e , f );
2181
2179
PdfName name = resources .addForm (form );
2182
- contentStream .getOutputStream ().write (name ).writeSpace ().writeBytes (Do );
2180
+ contentStream .getOutputStream ().write (( PdfObject ) name ).writeSpace ().writeBytes (Do );
2183
2181
restoreState ();
2184
2182
return this ;
2185
2183
}
@@ -2265,7 +2263,7 @@ private PdfCanvas addImage(PdfImageXObject image, float a, float b, float c, flo
2265
2263
saveState ();
2266
2264
concatMatrix (a , b , c , d , e , f );
2267
2265
PdfName name = resources .addImage (image );
2268
- contentStream .getOutputStream ().write (name ).writeSpace ().writeBytes (Do );
2266
+ contentStream .getOutputStream ().write (( PdfObject ) name ).writeSpace ().writeBytes (Do );
2269
2267
restoreState ();
2270
2268
return this ;
2271
2269
}
@@ -2274,7 +2272,7 @@ private PdfCanvas addImage(PdfXObject xObject, float a, float b, float c, float
2274
2272
saveState ();
2275
2273
concatMatrix (a , b , c , d , e , f );
2276
2274
PdfName name = resources .addImage (xObject .getPdfObject ());
2277
- contentStream .getOutputStream ().write (name ).writeSpace ().writeBytes (Do );
2275
+ contentStream .getOutputStream ().write (( PdfObject ) name ).writeSpace ().writeBytes (Do );
2278
2276
restoreState ();
2279
2277
return this ;
2280
2278
}
@@ -2368,7 +2366,8 @@ private void showTextInt(String text) {
2368
2366
2369
2367
private void addToPropertiesAndBeginLayer (IPdfOCG layer ) {
2370
2368
PdfName name = resources .addProperties (layer .getPdfObject ());
2371
- contentStream .getOutputStream ().write (PdfName .OC ).writeSpace ().write (name ).writeSpace ().writeBytes (BDC ).writeNewLine ();
2369
+ contentStream .getOutputStream ().write ((PdfObject ) PdfName .OC ).writeSpace ()
2370
+ .write ((PdfObject ) name ).writeSpace ().writeBytes (BDC ).writeNewLine ();
2372
2371
}
2373
2372
2374
2373
private Color createColor (PdfColorSpace colorSpace , float [] colorValue , PdfPattern pattern ) {
0 commit comments