diff --git a/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxOutputDevice.java b/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxOutputDevice.java
index 6d8cd6ba8..0389cf447 100644
--- a/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxOutputDevice.java
+++ b/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxOutputDevice.java
@@ -1042,8 +1042,11 @@ private void writeOutline(RenderingContext c, Box root) {
if (_bookmarks.size() > 0) {
// TODO: .setViewerPreferences(PdfWriter.PageModeUseOutlines);
- PDDocumentOutline outline = new PDDocumentOutline();
- _writer.getDocumentCatalog().setDocumentOutline( outline );
+ PDDocumentOutline outline = _writer.getDocumentCatalog().getDocumentOutline();
+ if (outline == null) {
+ outline = new PDDocumentOutline();
+ _writer.getDocumentCatalog().setDocumentOutline(outline);
+ }
writeBookmarks(c, root, outline, _bookmarks);
}