How to handle the issue of whiteboard or file display being incomplete or having blank spaces?
Problem Description
- Create a regular whiteboard, and after rendering, the whiteboard exceeds the size of the parent container.
- Create a file whiteboard, and after rendering, the whiteboard does not fill the parent container exactly, but has blank spaces on the top and bottom, left and right, or is centered.
- Multi-page file whiteboards (PDF, Office, etc.) briefly show blank areas in some regions when scrolling.
Problem Cause
-
For regular whiteboards, if the aspect ratio of the parent container to be mounted is different from the ratio of the width to height of the single page passed in when creating the whiteboard, the actual size after rendering will exceed the parent container size.
-
For file whiteboards, the rendering strategy is different from regular whiteboards, and there are also differences between different file types:
- Images with size less than or equal to 640400 will be enlarged proportionally to 640400 and displayed in the center.
- Static PPT, dynamic PPT, and custom H5 files are all scaled proportionally according to the original size of the file to ensure the file is displayed completely.
- Other files are scaled proportionally so that their width is consistent with the parent container width.
If the aspect ratio of the file single page is inconsistent with the aspect ratio of the parent container to be mounted, blank spaces may appear around it. It should be noted that when a PDF file meets the following conditions, the file sharing SDK will treat it as a PDF converted to PPT and apply the PPT rendering strategy: Each page of the PDF has the same aspect ratio, and
614 / 1280 <= height/width <= 1. -
The file sharing SDK internally uses lazy loading for each page of file content. In case of slow network speed, brief blank spaces will appear, indicating that the current file content has not been rendered yet.
Solution
Taking the web platform as an example:
- For issue 1 in the problem description, please ensure that the ratio of aspectWidth to aspectHeight passed in when creating the whiteboard is consistent with the aspect ratio of the parent container to be mounted.
- For issue 2 in the problem description, please modify the size of the parent container according to the actual situation to make it proportional to the file page to be displayed.
- For issue 3 in the problem description, it is not a functional issue and does not need to be resolved.
Related Links
- For creating a regular whiteboard, refer to Implementation Process.
- For creating a file whiteboard, refer to Combined Use of Interactive Whiteboard and File Sharing.
