Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.Canvas;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.properties.TextAlignment;
Expand Down Expand Up @@ -43,11 +44,11 @@ public void manipulatePdf(String htmlSource, String pdfDest) throws IOException

// Base URI is required to resolve the path to source files
ConverterProperties converterProperties = new ConverterProperties().setBaseUri(SRC);
HtmlConverter.convertToDocument(new FileInputStream(htmlSource), pdfDocument, converterProperties);
Document converted = HtmlConverter.convertToDocument(new FileInputStream(htmlSource), pdfDocument, converterProperties);

// Write the total number of pages to the placeholder
footerHandler.writeTotal(pdfDocument);
pdfDocument.close();
converted.close();
}

// Header event handler
Expand Down