Document Viewer (Studio Web Apps) - Document Not Displayed

I have an app in UiPath Studio, and I want to display a PDF document in the Document Viewer using the UiPath Bucket.

I’ve used the “Download Storage File” activity and assigned it to Viewer.Source or Viewer.Value in both ways:

JobAttachment.fromResource(file) or simply file

but it doesn’t work—there’s no error, and nothing is displayed.

However, using JobAttachment.fromResource(file).ToAppsFile does work, but it’s deprecated.

Hi @albertored,
Please try with the below steps:

  • Download the PDF from the Storage Bucket.
  • Convert the downloaded file to an Apps File object before binding it to the Document Viewer.
  • Since ToAppsFile is deprecated, use the newer Apps file/resource handling methods available in your UiPath Apps version.
  • Ensure the PDF is successfully downloaded and the file path is valid by checking the download activity output.
  • If the file is stored in a Storage Bucket, a better approach is to bind the Document Viewer directly to the Storage Bucket resource instead of using a local path.

Thanks

It doesn’t work directly from the Storage Bucket to the Document Viewer

Best regards

@albertored

Try this approach

  1. Use the built-in “Download from storage bucket” rule in Apps, not the Studio activity.
  2. Bind the output directly to an IResource app variable.
  3. Bind that variable to DocumentViewer.Source.

Hi @albertored

I faced a similar situation before. Since the file downloads without any error but the Document Viewer stays blank, it looks like the Viewer is not getting the file in the format it expects.

I would first check the Document Viewer’s Source/Value type and make sure it matches the output from Download Storage File.

Also, since JobAttachment.fromResource(file).ToAppsFile works, it confirms that the file itself is okay. The issue may be with how the newer file type is being passed to the Viewer.

I’d also check whether the latest Apps/Studio Web and activity package versions are being used. It could be a compatibility issue.