Getting exception when trying to use PWS and on-premises conversion with PDFNet


I just registered for PWS and am trying to use it to convert to XOD, but I get the following exception.

pdftron.Common.PDFNetException: Your license does not include WebPublisher permission. at pdftron.PDF.Convert.FileToXod(Native Method) at pdftron.PDF.Convert.toXod(

This is my code

PDFNet.initialize("your_key"); PDFNet.connectToCloud("your API_ID", "your API_Secret"); Convert.toXod("input_file_path", "output_file_path");

What am I doing wrong?


There is actually an error occurring when you are calling PDFNet.connectToCloud so you need to check the return code.

PDFNet.initialize("your_key"); int err_code = PDFNet.connectToCloud("pws_api_id", "pws_api_secret"); if(err_code != PDFNet.e_status_ok) { String err_msg = "Unexpected error. If this error persists please go to"; switch(err_code) { case PDFNet.e_status_network_err : err_msg = "Can’t establish a connection due networking error; Check your connectivity to the internet and firewall settings.If this error persists please go to"; break; case PDFNet.e_status_bad_Credentials : err_msg = "Credentials provided for authentication are incorrect. Make sure you are subscribed to pay as you go plan. You can check your subscription plan and credentials at"; break; case PDFNet.e_status_service_down : err_msg = "Server is not responding. If this error persists please go to"; break; case PDFNet.e_status_invalid_operation : err_msg = "Unexpected internal server error. If this error persists please go to"; break; } System.out.println("ERROR ConnectToCloud: " + err_msg); // or optionally throw instead here with the above error message }

If you are using one of the many command line tools, such as DocPub, that work with PWS, to get the same error message add

--verb 2

to your command line.