Not that anyone had a real answer for this problem so I managed to come up with a technique to solve this piece of stupidity...
Essentially, rather than attempting to LOAD the supplied PDF and watermark each of its pages, then save the result back out as a separate document. (This resulted in the squirrely behavior noted above)
I have instead Loaded the document into a PDFLoadedDocument object, then Created a new PDFDocument object, then iterated over the pages in the loaded document add each page to the newly opened document. At the end of that saved the newly opened document.
Then Loaded the newly create document into a PDFLoadedDocument object and watermaked each of its pages.
Why this works with over a dozen problem clild document I have for testing is unknown to me but it does seem to have solved this stupid problem...
Sample snippet shown below....
using (PdfImportedDocument ldoc = new PdfImportedDocument(fi1.FullName))
{
using (PdfDocument odoc = new PdfDocument(PdfDocumentConformanceLevel.Pdf_A1B))
{
pBar.Visible = true;
pBar.Maximum = ldoc.Pages.Count;
pBar.Value = 0;
foreach(PdfImportedPage p in ldoc.Pages)
{
odoc.ImportPage(ldoc, p);
pBar.Value = 1;
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(30);
}
pBar.Visible = false;
odoc.Save(Path.Combine(System.IO.Path.GetTempPath(), "Before_WM_" this.hashedFileName));
}
}
edited 3/4/2020 7:08:41 PM
answered 3/4/2020 7:05:09 PM