Cannot cover entire layer with image

PDF Sample with TOC.pdf (53.6 KB)
blawg.jpg (46.5 KB)

using var img = new FileStream("blawg.jpg", FileMode.Open);
var document = new Document("latex.pdf");
var page = document.Pages[1];
var rect = page.GetPageRect(false);
page.Resources.Images.Add(img);
var xImage = page.Resources.Images[page.Resources.Images.Count];

var matrix = new Matrix(new double[] { rect.URX - rect.LLX, 0, 0, rect.URY - rect.LLY, rect.LLX, rect.LLY });
var layer = new Layer("layer1", "layer1");
layer.Contents.Add(new GSave());
layer.Contents.Add(new ConcatenateMatrix(matrix));
layer.Contents.Add(new Do(xImage.Name));
layer.Contents.Add(new GRestore());
page.Layers.Add(layer);
document.Save("latex-modified.pdf");

@compagniedsdr

Do you want to add image behind the content on first page? Can you please share a sample expected output for our reference as well? We will further proceed accordingly.

I tried with another file and it works fine, do you happen to know why?
catalogue.pdf (6.3 MB)

catalogue-modified.pdf (6.4 MB)

@compagniedsdr

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56959

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.