Hello,
we have a problem with the Aspose.Pdf.AddStamp method.
Adobe Acrobat Reader can't open some of our Pdfs after stamping.
We use the following code snippet to stamp our Pdfs:
var textStamp = new Aspose.Pdf.TextStamp(stampText)
{
Background = false,
Opacity = 0.5,
RotateAngle = 50,
HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center,
VerticalAlignment = Aspose.Pdf.VerticalAlignment.Center,
TextAlignment = Aspose.Pdf.HorizontalAlignment.Center
};
textStamp.TextState.Font = FontRepository.FindFont("Arial");
textStamp.TextState.FontSize = 72.0f;
textStamp.TextState.FontStyle = FontStyles.Bold;
textStamp.TextState.FontStyle = FontStyles.Italic;
textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.FromArgb(121, 177, 0));
var pdfDoc = new Aspose.Pdf.Document(fileName);
for (var i = 1; i <= pdfDoc.Pages.Count; i++)
pdfDoc.Pages[i].AddStamp(textStamp);
pdfDoc.Save(outFileName);
In the attachment you will find one Pdf before and after stamping.
Maybe there is a connection to the exception that is shown in debug output after call of AddStamp.
'A first chance exception of type 'System.IO.EndOfStreamException' occurred in mscorlib.dll'
Thank you very much for your support.
Kind regards,
Oliver
we have a problem with the Aspose.Pdf.AddStamp method.
Adobe Acrobat Reader can't open some of our Pdfs after stamping.
We use the following code snippet to stamp our Pdfs:
var textStamp = new Aspose.Pdf.TextStamp(stampText)
{
Background = false,
Opacity = 0.5,
RotateAngle = 50,
HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center,
VerticalAlignment = Aspose.Pdf.VerticalAlignment.Center,
TextAlignment = Aspose.Pdf.HorizontalAlignment.Center
};
textStamp.TextState.Font = FontRepository.FindFont("Arial");
textStamp.TextState.FontSize = 72.0f;
textStamp.TextState.FontStyle = FontStyles.Bold;
textStamp.TextState.FontStyle = FontStyles.Italic;
textStamp.TextState.ForegroundColor = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.FromArgb(121, 177, 0));
var pdfDoc = new Aspose.Pdf.Document(fileName);
for (var i = 1; i <= pdfDoc.Pages.Count; i++)
pdfDoc.Pages[i].AddStamp(textStamp);
pdfDoc.Save(outFileName);
In the attachment you will find one Pdf before and after stamping.
Maybe there is a connection to the exception that is shown in debug output after call of AddStamp.
'A first chance exception of type 'System.IO.EndOfStreamException' occurred in mscorlib.dll'
Thank you very much for your support.
Kind regards,
Oliver