My Questions:
public byte[] ConvertToPDFA3Bytes(string srcPDF, string xmlPath, string xmlFileName)
{
iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(srcPDF);
using MemoryStream ms = new MemoryStream();
using (PdfStamper stamper = new PdfStamper(reader, ms))
{
PdfFileSpecification pfs = PdfFileSpecification.FileEmbedded(stamper.Writer, xmlPath, xmlFileName, null);
stamper.AddFileAttachment(xmlFileName.Replace(".xml", ""), pfs);
}
iText.Kernel.Pdf.PdfWriter myPDFWriter = new iText.Kernel.Pdf.PdfWriter(ms);
return ms.ToArray();
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,807 Super User 2024 Season 2
Martin Dráb 229,135 Most Valuable Professional
nmaenpaa 101,156