I have made a program that encrypts and decrypts pdf files. I want them to be locked for anyone but me and to open them via my program only. After I encrypt the pdf I have it in a byte array. Is there anyway to display the decrypted byte array of the pdf file to the form without deploying the file to the drive?
What you need is a WinForms PDF viewer component that can load a PDF from a byte array. With the PDF viewer from Gnostice PDFOne .NET, here is the code:
PDFViewer PDFViewer1;
byte[] baPDF; // load the decrypted PDF to this byte array
...
PDFViewer1.LoadDocument(baPDF);
NOTE: I work for this Gnostice company. Any other PDF viewer component, if it can load from a byte array, will work.
There is no need to save the decrypted PDF to the disk.