0

I need to capture model view screenshots and use them later. When I capture the screenshot, save and render without refreshing page. it works but when I refresh the page, it renders with broken screenshot image.

What I am doing -

  1. Capture screenshot using viewer.getScreenShot
  2. Persist the blob url to db
  3. render broken image after refreshing the page or using it later.
sushilprj
  • 1,953
  • 1
  • 12
  • 17
  • What version of the Viewer are you currently using, you can check from your devtools console with LMV_VIEWER_VERSION – Jaime Rosales Jan 02 '18 at 14:59
  • @JaimeRosales - "3.2" – sushilprj Jan 02 '18 at 16:31
  • @JaimeRosales - I have figured out the issue. It's happening due to saving blob url into my db which refer to browse cache screenshot image. Somehow I need to upload the blob and store in s3. – sushilprj Jan 02 '18 at 16:37

1 Answers1

1

Not sure what tech you are using on your backend, but simply download the image from the url and store it in your DB ...

Alternatively you could automate the whole process of generating screenshots, take a look at those articles:

Running Forge Viewer headless in Chrome with Puppeteer

Screenshot automation of 2D Drawings with Forge Viewer and Headless Chrome

Philippe
  • 4,130
  • 1
  • 11
  • 17
  • Thanks @philippe-leefsma, I have created a canvas and render the blob image inside the canvas and then upload it to s3. It's working for me. https://stackoverflow.com/questions/12391628/how-can-i-upload-an-embedded-image-with-javascript – sushilprj Jan 05 '18 at 10:52