[Ultimate PDF] Exception thrown on calling PrintToPDF_Advanced
Reactive icon
Forge component by Leonardo Fernandes
Application Type
Service Studio Version
11.54.30 (Build 62899)

I have a simple reactive page displaying a report as a table within a PrintLayout set as LandscapeA4 page size and 1cm border.
When accessing the page containing the report in the browser it all loads fine.

I have  a client action on another page that calls PrintToPDF_Advanced with the report URL (within the same application).
User clicks button to get the report, but an exception is thrown.
This is what I fished out of Service Center from the logs recoreded for my applciation.

An error occurred while generating the pdf   at ssUltimatePDF.Actions.ActionPrintToPDF_Advanced(HeContext heContext, String inParamURL, STUserEnvironmentStructure inParamEnvironment, String inParamPaperSize, String inParamMarginSize, Byte[]& outParamPDF)   at ssPago.RsseSpaceUltimatePDF.MssPrintToPDF_Advanced(HeContext heContext, String inParamURL, IRecord inParamEnvironment, String inParamPaperSize, String inParamMarginSize, Byte[]& outParamPDF)   at ssPago.ScreenServices.Pago_MainFlow_SettlementDetail_Controller.b__5(HeContext heContext, String screenName, JObject screenModel, JObject inputParameters, JObject clientVariables)   at OutSystems.RESTService.Controllers.ScreenServicesApiController.endpoint(String input, String endpointName, String apiVersion, EndpointImplementationDelegate implementation)

On drilling into this a little further with the debugger I found that in the Ultimate PDF module, PrintPDF_Proxy calls the  ServiceTry action which then calls the StartBrowserSession method.
StartBrowserSession is throwing the exception which is eventually caught by PrintPDF_Proxy and re-thrown back to my application as a fairly generic exception type 'Error'.

The exception thrown by StartBrowserSession contains the message
"Method not found: 'Void OutSystems.NssUltimatePDF_Utils.IssUltimatePDF_Utils.MssStartBrowserSession(System.String, System.String ByRef, System.String ByRef, System.String ByRef, Boolean ByRef, OutSystems.NssUltimatePDF_Utils.RLSessionCookieRecordList ByRef)'."

As I mentioned before, the exact same url renders fine in the browser. As a temporary solution I have been redirecting clients to the same URL with no issues.  
We thought that maybe the issue might be related to permissions, so I opened the page up to Anonymous users just to rule out permissions as the cause. No change.
Here's the strange bit.... If I refresh references  in my app and re-publish, it starts woring fine in the current environment.
I figured since that worked, then we should now be able to deploy to the upper environments without any complications, so off I went and deployed  Ultimate PDF and my application to the upper environment.
On testing in the upper environment, we were back to square one...  Same issue with the missing method 'MssStartBrowserSession'.
Despite deploying UltimatePDF and my application together with resfreshed reference, unless I refresh references and re-publish in the same environment we get a repeat of 'Method not found'.
It's an issue once we reach the production environment.

I was wondering if you might have experienced this before, and how to go about solving th issue?

Kind regards and much appreciated. 


Screenshot 2023-11-08 155140.png
Screenshot 2023-11-08 154622.png
Screenshot 2023-11-08 155002.png

Hi Trevor.

Does this happen in all environments?

Can you check if you don't have any broken or outdated dependencies? This method not found error indicates that the UltimatePDF_Utils extension, or some module that uses it, is not correctly published.

From your stack trace, I can see the Ultimate PDF action is being invoked from the Pago module. You can try to republish the application that contains Pago and see if that fixes the issue.

We have other applications in traditional web that use a very similar method and have no issues. This as the first use in Reactive.

If I refresh dependencies and republish then it works fine, but only up until we deploy to an upper environment.
Even if we deploy Ultimate PDF along side my application, the same issue resurfaces.
I'll see if I can reproduce the error in  another Reactive application.

I would recommend you to start a support case, since this seems to be caused by a compilation error or dependency error. Especially since you're saying that republishing fixes the issue, this confirms that the cause of the error is probably not from Ultimate PDF itself.

We might have to do that.
I started a new application and set up a test case using UltimatePDF in exactly the same way as with the problem application.
Everything continued to work fine after deploying to upper environments.
It's a bit of a mystery. I'm sure there must be a logical explanation for it.
Support case seems like the way to go. 

Thanks for your support Leonardo.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.