@@ -22,7 +22,7 @@ This file is part of the iText (R) project.
22
22
*/
23
23
package com .itextpdf .html2pdf .resolver .resource ;
24
24
25
- import com .itextpdf .commons .utils .Base64 ;
25
+ import com .itextpdf .commons .utils .EncodingUtil ;
26
26
import com .itextpdf .commons .utils .FileUtil ;
27
27
import com .itextpdf .html2pdf .attach .ProcessorContext ;
28
28
import com .itextpdf .html2pdf .attach .util .ContextMappingHelper ;
@@ -32,7 +32,6 @@ This file is part of the iText (R) project.
32
32
import com .itextpdf .styledxmlparser .resolver .resource .IResourceRetriever ;
33
33
import com .itextpdf .styledxmlparser .resolver .resource .ResourceResolver ;
34
34
import com .itextpdf .svg .converter .SvgConverter ;
35
- import com .itextpdf .svg .element .SvgImage ;
36
35
import com .itextpdf .svg .processors .ISvgProcessorResult ;
37
36
import com .itextpdf .svg .processors .impl .SvgConverterProperties ;
38
37
@@ -108,7 +107,7 @@ protected PdfXObject tryResolveBase64ImageSource(String src) {
108
107
String fixedSrc = src .replaceAll ("\\ s" , "" );
109
108
if (fixedSrc .startsWith (SVG_PREFIX )) {
110
109
fixedSrc = fixedSrc .substring (fixedSrc .indexOf (BASE64_IDENTIFIER ) + BASE64_IDENTIFIER .length () + 1 );
111
- try (ByteArrayInputStream stream = new ByteArrayInputStream (Base64 . decode (fixedSrc ))) {
110
+ try (ByteArrayInputStream stream = new ByteArrayInputStream (EncodingUtil . fromBase64 (fixedSrc ))) {
112
111
PdfFormXObject xObject = HtmlResourceResolver .processAsSvg (stream , context , null );
113
112
if (xObject != null ) {
114
113
return xObject ;
0 commit comments