Using the following code to convert HTML text string into PDF file (only for print access) with password,
but it seems not working (no pdf file generated):
thread=new Thread(() => { pdfdoc.LoadFromHTML(htmltext,false,pagesetting,htmllayoutformat); pdfdoc.Security.Encrypt("password","password",Spire.Pdf.Security.PdfPermissionsFlags.Print,Spire.Pdf.Security.PdfEncryptionKeySize.Key128Bit); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
Is there anything wrong with the code?