Overlay PDF (Byte Array) onto Certain Pages of an ActiveReport

Posted by: rkuehn on 4 November 2021, 8:57 am EST

  • Posted 4 November 2021, 8:57 am EST

    I’m working in a custom program that uses AR6. I’m using C# in VS 2019 on Windows 10 Pro and targeting .NET Framework 4.7.2 in my solution. My report designers are based on classes that are ultimately based on a SectionReport object.

    I have a PDF sent to me as a byte array from an outside source that I want to overlay onto certain pages of an ActiveReport I built. I thought the process would be as simple as:

    		Stream 
    			reportStream = new MemoryStream(pdfByteArray);
    		Document 
    			reportDoc = new Document();
    
    		reportDoc.Load(reportStream);
    
    		for (int i = locationinAR; i < pageCount; i++)
    			pages[i].Overlay(reportDoc.Pages[i]);
    

    But I’m getting the error “Invalid file format, the guids do not match” on the “reportDoc.Load(reportStream);” line, so I expect I’m missing something obvious. How should I code this?

  • Posted 4 November 2021, 9:23 am EST

    And just to be clear, I know that the byte array is a valid PDF. I saved it to disk and opened it to verify.

  • Posted 7 November 2021, 4:05 pm EST

    Hello,

    AR6 is a legacy product now. We do not support it. I suggest you to upgrade to the latest version.

    Also, you cannot load the PDF document in the SectionDocument.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels