How to handle the issue of incomplete whiteboard display or blank space?
Problem Description
- Create a pure whiteboard, and after rendering, the whiteboard exceeds the parent container size.
- Create a file whiteboard, and after rendering, the whiteboard does not fill the parent container exactly, but has blank space at the top and bottom, left and right, or is centered.
- Multi-page file whiteboards (PDF, Office, etc.) will briefly show blank areas in some regions when scrolling.
Problem Cause
-
For pure 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 rendered actual size will exceed the parent container size.
-
For file whiteboards, the rendering strategy is different from ordinary whiteboards, and there are also differences between different file types:
- Images with size less than or equal to 640 * 400 will be enlarged proportionally to 640 * 400 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 space may appear around it. It should be noted that when a PDF file meets the following conditions, Superboard SDK will treat it as a PDF converted from PPT and apply the PPT rendering strategy: the aspect ratio of each page of the PDF is the same, and
614 / 1280 <= height/width <= 1. -
Superboard SDK internally uses lazy loading for each page of file content. When the network speed is slow, there will be a brief blank, 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, ensure that the ratio of width to height 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, modify the parent container size 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.
