Spire PDF for Java 10.11.2 supports converting HTML strings to PDF documents

Spire PDF for Java 10.11.2 supports converting HTML strings to PDF documents

2024-11-29 08:20:02

We are excited to announce the release of Spire PDF for Java 10.11.2. The latest version supports converting HTML strings to PDF documents using ChromeHTMLConverter. Besides, some known bugs are fixed successfully in the update, such as the issue that content was lost when converting PDF to PDFA2A. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New feature SPIREPDF-7165 Supports converting HTML strings to PDF documents using ChromeHTMLConverter.
ChromeHtmlConverter converter = new ChromeHtmlConverter(TestUtil.ChromiumPath);
URI uri = new URI(converter.getUrl());
IWebSocketService webSocketService = (IWebSocketService) WebSocketServiceImpl.create(uri);
converter.setWebSocketService(webSocketService);

String htmlString = "<html><body><p style=\' color:black \'>E-iceblue</p></body></html>";

converter.convertToPdf(htmlString, OutputPath, null);
New feature SPIREPDF-7184 Supports enabling 'Background graphics' when using ChromeHTMLConverter to convert HTML to PDF.
ChromeHtmlConverter converter = new ChromeHtmlConverter(TestUtil.ChromiumPath);
URI uri = new URI(converter.getUrl());
IWebSocketService webSocketService = (IWebSocketService) WebSocketServiceImpl.create(uri);
converter.setWebSocketService(webSocketService);

ConvertOptions options = new ConvertOptions();
options.setTimeout(10 * 1000);
options.setPageSettings(new PageSettings(PaperFormat.A4));
options.getPageSettings().setMarginTop(0);
options.getPageSettings().setMarginBottom(0);
options.getPageSettings().setMarginLeft(0);
options.getPageSettings().setMarginRight(0);
options.getPageSettings().setPrintBackground(true); 
converter.convertToPdf(url, OutputPath, options);
Bug SPIREPDF-6945 Fixes the issue that content was lost when converting PDF to PDFA2A.
Bug SPIREPDF-7157 Fixes the issue that content overlapped when converting SVG to PDF.
Bug SPIREPDF-7160 Fixes the issue that the program threw "Value cannot be null" error when merging documents.
Bug SPIREPDF-7191 Fixes the issue that attachments were lost during PDF to OFD conversion.
Click the link below to download Spire PDF for Java 10.11.2: