@@ -22,7 +22,7 @@ This file is part of the iText (R) project.
2222 */
2323package com .itextpdf .html2pdf .resolver .resource ;
2424
25- import com .itextpdf .commons .utils .Base64 ;
25+ import com .itextpdf .commons .utils .EncodingUtil ;
2626import com .itextpdf .commons .utils .FileUtil ;
2727import com .itextpdf .html2pdf .attach .ProcessorContext ;
2828import com .itextpdf .html2pdf .attach .util .ContextMappingHelper ;
@@ -32,7 +32,6 @@ This file is part of the iText (R) project.
3232import com .itextpdf .styledxmlparser .resolver .resource .IResourceRetriever ;
3333import com .itextpdf .styledxmlparser .resolver .resource .ResourceResolver ;
3434import com .itextpdf .svg .converter .SvgConverter ;
35- import com .itextpdf .svg .element .SvgImage ;
3635import com .itextpdf .svg .processors .ISvgProcessorResult ;
3736import com .itextpdf .svg .processors .impl .SvgConverterProperties ;
3837
@@ -108,7 +107,7 @@ protected PdfXObject tryResolveBase64ImageSource(String src) {
108107 String fixedSrc = src .replaceAll ("\\ s" , "" );
109108 if (fixedSrc .startsWith (SVG_PREFIX )) {
110109 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 ))) {
112111 PdfFormXObject xObject = HtmlResourceResolver .processAsSvg (stream , context , null );
113112 if (xObject != null ) {
114113 return xObject ;
0 commit comments