This happens in ASP.net Core
AsposeConsole.zip (1.4 MB)
docpfd.Save was never returning goes to infinite loop,
Added sample documents where we face the issue.
var basePath = AppDomain.CurrentDomain.BaseDirectory;
var docPdf = new Document(basePath + "\\" + "Related.pdf");
var stampPdf = new Document(basePath + "\\" + "cover-landscape.pdf");
var cover = docPdf.Pages.Insert(1);
PdfPageStamp pageStamp = new PdfPageStamp(stampPdf.Pages[1]);
pageStamp.Background = true;
pageStamp.XIndent = 0;
pageStamp.YIndent = 0;
cover.AddStamp(pageStamp);
TextFragment title = new TextFragment("Page Title");
title.Margin = new MarginInfo(70, 10, 70, 280);
title.TextState.HorizontalAlignment = HorizontalAlignment.Center;
title.TextState.FontSize = 32;
cover.Paragraphs.Add(title);
var pageCollection = docPdf.Pages;
Page pdfPage = pageCollection[1];
pdfPage.SetPageSize(Math.Round(docPdf.Pages[2].GetPageRect(true).Width), Math.Round(docPdf.Pages[2].GetPageRect(true).Height));
docPdf.Save(basePath + "\\" + "Result.pdf");