Horje
c# itext 7 PdfDocument from byte array Code Example
c# itext 7 PdfDocument from byte array
using (MemoryStream ms = new MemoryStream())
using (PdfDocument pdf = new PdfDocument(new PdfWriter(ms).SetSmartMode(true)))
{
    // Create reader from bytes
    using (MemoryStream memoryStream = new MemoryStream(pdf1.DocumentBytes))
    {
        // Create reader from bytes
        using (PdfReader reader = new PdfReader(memoryStream))
        {
            PdfDocument srcDoc = new PdfDocument(reader);
            srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf);
        }
    }

    // Create reader from bytes
    using (MemoryStream memoryStream = new MemoryStream(pdf2.DocumentBytes))
    {
        // Create reader from bytes
        using (PdfReader reader = new PdfReader(memoryStream))
        {
            PdfDocument srcDoc = new PdfDocument(reader);
            srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf);
        }
    }

    // Close pdf
    pdf.Close();

    // Return array
    return ms.ToArray();
}




Csharp

Related
convert uk string date to DateTime c# Code Example convert uk string date to DateTime c# Code Example
How to make game object transparent in unity Code Example How to make game object transparent in unity Code Example
return array in c# Code Example return array in c# Code Example
togl unity Code Example togl unity Code Example
integer required asp.net core Code Example integer required asp.net core Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10