Resolve page parents when adding page to writer (#110)

This commit is contained in:
Adrian-George Bostan 2019-07-05 19:02:25 +03:00 committed by Gunnsteinn Hall
parent 2189002435
commit 2689453ae1

View File

@ -584,7 +584,7 @@ func (w *PdfWriter) AddPage(page *PdfPage) error {
// Copy inherited fields if missing.
inheritedFields := []core.PdfObjectName{"Resources", "MediaBox", "CropBox", "Rotate"}
parent, hasParent := pDict.Get("Parent").(*core.PdfIndirectObject)
parent, hasParent := core.GetIndirect(pDict.Get("Parent"))
common.Log.Trace("Page Parent: %T (%v)", pDict.Get("Parent"), hasParent)
for hasParent {
common.Log.Trace("Page Parent: %T", parent)