142
Views
14
Comments
Solved
[Ultimate PDF] UltimatePDF Reference to https://storage.googleapis.com/
Question
Forge component by Leonardo Fernandes
15
Published on 08 Jan 2021

Dears,

We are using Ultimate pdf to convert html to pdf. It goes to https://storage.googleapis.com to check the chromium version while setting the local browser.

Our Information Security team is asking what exactly is being to google apis and what does apis do to set up the local browser.

Could you please provide the details? Thanks for your help.

Regards,

Zubair

UltimatePDFSetUpLocalBrowser.jpg

mvp_badge
MVP
Rank: #5
Solution

Hi Zubair.

It uses that URL to download Chromium binaries. This allows the component to work without requiring any setup.

If you can't have that dependency, you're going to have to provide the binaries yourself. You can use the action SetupDefaultChromiumBrowserRevision or SetupBrowserRevision to provide the binaries without requiring a connection to any external server. You only need to do this once per environment.

Rank: #1652

Leonardo Fernandes wrote:

Hi Zubair.

It uses that URL to download Chromium binaries. This allows the component to work without requiring any setup.

If you can't have that dependency, you're going to have to provide the binaries yourself. You can use the action SetupDefaultChromiumBrowserRevision or SetupBrowserRevision to provide the binaries without requiring a connection to any external server. You only need to do this once per environment.

Dear Leonardo,

Thanks for your response.I used SetupBrowserRevision action and passed the binaries as zip to this server action. It is working fine. However the component is always expecting the files under C:\WINDOWS\TEMP\.local-chromium, and since its under Windows Temp dierctory there is risk folder might be deleted during temporary files clean up on the server.

Is there a way we can change the directory path for this component. I tried to modify chrlauncher.ini by giving full path as ChromiumDirectory = D:\.local chromium instead of ChromiumDirectory=.\bin but I encountered the error below

Could not find a part of the path 'C:\WINDOWS\TEMP\.local-chromium\Win64-637110\chrlauncher-win64-stable-ungoogled\chrlauncher - official website - donation.url'.


Any inputs on changing the directory will be highly appreciated.

Thanks,

Zubair


mvp_badge
MVP
Rank: #5

Zubair, it's not possible to change that path at the moment. I might add that feature in future versions.

Rank: #1652

Leonardo Fernandes wrote:

Zubair, it's not possible to change that path at the moment. I might add that feature in future versions.

Dear Leonardo, Thanks for updates. Regards,Zubair


Rank: #1652

Dear Leonardo,

Just following up on this, if you had time to look on changing the path for this component binary files.

Thanks

Zubair

mvp_badge
MVP
Rank: #5

Hi Zubair. The latest release has a site property that allows you to change which folder will be used to download and unpack the Chromium browser.

Rank: #1652

Dear Leonardo,

Thanks for your help. I shall download the latest release and apply the same.

Regards,

Zubair

Rank: #1652

Dear Leonardo,

We used the latest plugin however we are getting the error "Failed to launch browser! path to executable does not exist", we have the local set up files present under C:\Windows\Temp\.local-chromium and the site property PreventAutomaticDownloads  is True. We tried with and without temporary folder path but still same error.

Attaching the screenshot of the site properties configuration and error.

Could you please advise how we can fix this error?

Thanks,

Zubair



Rank: #85157

Hi Zubair. Make sure the following file exists and is readable by IIS_IUSRS: C:\Windows\Temp\.local-chromium\Win64-706915\chrome-win\chrome.exe

That is the path the extension is expecting. I will change the extension so that it includes more relevant information in the error message.

Rank: #1652


Dear Leonardo,

Thanks for your reply. We did give the permission to IIS_Users however it still gave the same error. Also we did the following settings to run the application with an user(Application - Operation - Run As - Entered user details) who has full permission on the folder but still same error. Below is the configuration details of the application and site properties.


Could you please advise if we are missing something here?

mvp_badge
MVP
Rank: #5

Zubair, you should set the TemporaryFolder site property to C:\Windows\Temp (or leave it blank since this is the default).

Let me know if that fixes your issue. If it doesn't, try using the last release, which will generate an error that includes the expected path of the executable.

Rank: #1652

Dear Leonardo,

Good Day. Thanks for your response.

We had tried with C:\Windows\Temp or blank but both were giving error. However I noticed that the component is always checking for folder Win64-706915 under .local-chromium and in our case the temp folder was created as Win64-637110 hence it was giving the error.

The old error was resolved after renaming Win64-637110 to Win64-706915. However now we are getting another error "http://hostname/UltimatePDFDemo/SampleReport01.aspx: Protocol error (IO.read): Invalid parameters handle: string value expected".

Please note that it is coming after updating LocalServerProtocol site property to "http", with blank i.e. https it gives the SSL certificate error "err_cert_common_name_invalid" As we don't have matching certificate in test environment and would like to make it work with http.

Below is the complete stack trace of the error and also the site property configuration

Protocol error (IO.read): Invalid parameters handle: string value expected

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at PuppeteerSharp.CDPSession.<SendAsync>d__30.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at PuppeteerSharp.CDPSession.<SendAsync>d__29`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at PuppeteerSharp.Helpers.ProtocolStreamReader.<ReadProtocolStreamByteAsync>d__1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at PuppeteerSharp.Page.<PdfInternalAsync>d__171.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at OutSystems.NssUltimatePDF.Browser.BrowserExecutionContext.<PrintPDF>d__9.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at OutSystems.NssUltimatePDF.CssUltimatePDF.RunAsync[T](Func`1 async)

   at OutSystems.NssUltimatePDF.CssUltimatePDF.MssPrintPDF(String ssURL, String ssTemporaryFolder, Int32 ssBrowserRevision, RCViewportRecord ssViewport, RCPaperRecord ssPaper, String ssSessionCookieDomain, Byte[]& ssPDF)


   at ssUltimatePDF.RssExtensionUltimatePDF.MssPrintPDF(HeContext heContext, String inParamURL, String inParamTemporaryFolder, Int32 inParamBrowserRevision, IRecord inParamViewport, IRecord inParamPaper, String inParamSessionCookieDomain, Byte[]& outParamPDF)



mvp_badge
MVP
Rank: #5

Hi Zubair.

I believe you are using an older version of Google Chrome, which may have a different DevTools protocol. Please download the revision 706915 from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/706915/ (it's the chrome-win.zip).

You can also try with a more recent version if you like. If you do that, you can change the DefaultChromiumBrowserRevision site property to match the revision number, and don't change the folder name.

Rank: #1652

Dear Leonardo,

Thank you very much for your help and support!

The issue has been resolved after downloading revision 706915 from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/706915/ (it's the chrome-win.zip) 

Regards,

Zubair