How to apply PDF Viewer license key so I can view a form in VS Designer

0
Hello - I have a valid license for my PDF Viewer and have applied it to my application which works well after being compiled. However when trying to view a form with form designer it throws an error saying the license is expired or invalid. Is there any way to configure the code or VS to apply the license key so we can view a form with PDF Viewer control on it in designer? I tried adding the key in the InitializeComponent() code of the form but the designer still will not allow the control to be created. While I can work around this for now it is somewhat inconvenient in making form updates without being able to view all the controls on the form in designer mode. The designer mode did work properly when I first downloaded and installed the PDF Viewer after purchasing it (about two months ago) - apparently it thinks it is the trial version until the license key can be applied - but obviously the form designer wrapper code is unable to do that. Thanks for any assistance. Scott Turner
edited 6/30/2022 10:52:44 AM
asked 6/30/2022 10:47:11 AM
add a comment

2 Answers

0
Apparently you did not read my question. I stated the problem is that the Visual Studio Form ***Designer*** throws the error when trying to render a form with a PDF Viewr control on it. It did work initially when I first installed the software which tells me that despite the correct implementaion the License is not being applied when the VS Designer renders the form and is just using the default "trial key" which of course has expired. My code is below: As you can see it is consistent with yours. It works find when the Main() program is executing but not in VS Designer mode as I stated. I did try using "**ComponentPro.Licensing.*Saml*.LicenseManager..SetLicenseKey(ComponentPro.LicenseKey.Key)**;" as you suggested but that namespace is unknown to the PDFViewer lib. You must have cut and pasted that from another answer. static void Main() { ComponentPro.Licensing.PdfViewer.LicenseManager.SetLicenseKey(ComponentPro.LicenseKey.Key);// PDFViewer license key: Application.ThreadException = new ThreadExceptionEventHandler(Application_ThreadException); // capture any thread exception for the log Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException = new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
edited 7/14/2022 5:49:24 PM
answered 7/14/2022 5:19:06 PM
add a comment
0
Hi Scott, We advise setting the license key, in the following way. /// [STAThread] static void Main() { ComponentPro.Licensing.Saml.LicenseManager.SetLicenseKey(ComponentPro.LicenseKey.Key); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Saml2Demo()); } Thanks for contacting us.
 
answered 7/14/2022 12:45:42 AM
  My existing code is below: As you can see it is consistent with your directive, However this is not working when viewing a form with TDF Viewer control in VS Designer as I stated. I did try using "**ComponentPro.Licensing.Saml.LicenseManager..SetLicenseKey(ComponentPro.LicenseKey.Key)**;" as you suggested but that namespace is unknown to the PDFViewer lib. Please advise. What namespace is "*Saml*"? static void Main() { ComponentPro.Licensing.PdfViewer.LicenseManager.SetLicenseKey(ComponentPro.LicenseKey.Key);// PDFViewer license key: Application.ThreadException = new ThreadExceptionEventHandler(Application_ThreadException); // capture any thread exception for the log Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException = new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } Scott 7/14/2022 5:18:53 PM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged pdf-viewer or ask your own question.