Skip to content

Commit a9e085a

Browse files
committed
Deprecate iharder implementation of Base64 in favor JDK implementation
1 parent bce2c1a commit a9e085a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/com/itextpdf/html2pdf/resolver/resource/HtmlResourceResolver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This file is part of the iText (R) project.
2222
*/
2323
package com.itextpdf.html2pdf.resolver.resource;
2424

25-
import com.itextpdf.commons.utils.Base64;
25+
import com.itextpdf.commons.utils.EncodingUtil;
2626
import com.itextpdf.commons.utils.FileUtil;
2727
import com.itextpdf.html2pdf.attach.ProcessorContext;
2828
import com.itextpdf.html2pdf.attach.util.ContextMappingHelper;
@@ -32,7 +32,6 @@ This file is part of the iText (R) project.
3232
import com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever;
3333
import com.itextpdf.styledxmlparser.resolver.resource.ResourceResolver;
3434
import com.itextpdf.svg.converter.SvgConverter;
35-
import com.itextpdf.svg.element.SvgImage;
3635
import com.itextpdf.svg.processors.ISvgProcessorResult;
3736
import 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

Comments
 (0)