IronPdf / Iron-Pdf-Documentation

ReadTheDocs Build Files for IronPDF C#/.Net PDF Library http://ironpdf.com
8 stars 2 forks source link

IronPdf stamper not working #25

Open vikranth-fullstack opened 1 year ago

vikranth-fullstack commented 1 year ago

HI Team,

We are using IronPdf latest version 2023.5.0.8 and .Net framework 4.7.1, I'm applying stamping using HTML stamper method, it is working locally when running through VS2022, the same code when published and deployed to server it is not working, surprisingly it is not throwing any exceptions or logs. Below are the server details Windows Server 2019 .Net framework version 3.5 and 4.

below is the code we using for applying stamping and saving the file.

using (IronPdf.PdfDocument cpyDoc = sourceDocument.CopyPage(selectedPages)) {

                var stamper = new HtmlStamper("<p style='color:red;font-size:12px;margin-left:5px;'>" + header + "<b> -Page " + (selectedPages + 1) + "</b></p>")
                {
                    HorizontalOffset = new Length(-1, MeasurementUnit.Pixel),
                    VerticalOffset = new Length(-8, MeasurementUnit.Pixel),
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    IsStampBehindContent = false
                };
                cpyDoc.ApplyStamp(stamper);
                cpyDoc.TrySaveAs(outputPDFpath + "\\" + fileFullName);
            }

the same code used to work till previous OS updates, any updates/changes need to do in order to work in server with latest patch updates. Any help is much apricated as it is PROD issue now need to fix ASAP.

Thanks, Vikranth CH.