Showing posts with label AX2012 PDF generation. Show all posts
Showing posts with label AX2012 PDF generation. Show all posts

Thursday, April 9, 2020

Generate PDF using iTextSharp dll in AX2012

public str createreceipt(TransactionID _transactionId)
        #{
        #    iTextSharp.text.Document        document;
        #    iTextSharp.text.pdf.PdfWriter   pdfwriter;
        #    iTextSharp.text.Paragraph       para;
        #    System.IO.FileStream            fileStream;
        #    str                                           path;
        #    ;
        #
        #    path = strFmt(@"%1\%2.pdf",DocuParameters::find().ArchivePath,_transactionId);
        #    fileStream = new System.IO.FileStream(path,System.IO.FileMode::Create);
        #    document = new iTextSharp.text.Document();
        #    pdfwriter = iTextSharp.text.pdf.PdfWriter::GetInstance(document,fileStream);
        #    document.Open();
        #    para        = new iTextSharp.text.Paragraph("hello world");
        #    document.Add(para);
        #    document.Close();
        #    info(path);
        #    return path;
        #
        #}