Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Upgraded to latest Aspose.NET Total, can't work with header/footers anymore

$
0
0
Before upgrading I was handling adding header/footers via memorystreams, now the constructor is deprecated. How can I still provide the same functionality working with streams, not files.

 private static MemoryStream SetHeaderAndFooter(MemoryStream pdf, string header, string footer)
  {
            var outputPdf = new MemoryStream();
            try
            {
               var fileStamp = new PdfFileStamp(pdf,outputPdf);
                fileStamp.AddHeader(headerText, 5);
fileStamp.AddFooter(footerText, 10, 0, 0);
                fileStamp.Close();

                return new MemoryStream(outputPdf.ToArray());
            }
    catch .....
}

Viewing all articles
Browse latest Browse all 3131