We are running the WebViewer SDK in a cross-platform Capacitor App. The WebViewer is built in the Angular Frontend in JavaScript/TypeScript.
When I open a PDF on an iPhone Simulator, the view doesn’t match the screen size. See Screenshot for further explanation.
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems like the issue you’re experiencing with the WebViewer on an iPhone Simulator could be related to CSS styling or how the WebViewer is initialized. The WebViewer should ideally adjust to the screen size, but sometimes specific CSS properties or initialization parameters can affect its behavior.
Some things you can try:
Ensure that the WebViewer’s parent container is correctly set to flex or has a responsive design. Sometimes, setting the parent container to display: flex can help maintain proper scaling.
Check the viewport meta tag in your HTML file. Ensure it is set to <meta name="viewport" content="width=device-width, initial-scale=1.0"> to allow proper scaling on mobile devices.
Adjust the WebViewer’s initialization parameters to ensure it fits within the container. You may need to specify the fullScreen or similar options.
Debug the CSS to identify if any other styling is affecting the WebViewer’s container dimensions.
Here are some resources that might help you:
Viewer Customization: This guide can help you understand how to customize the WebViewer’s appearance and behavior.
Annotation Customization: Learn how to customize annotations, which might be affecting layout if they are not properly sized.
Mobile Support: This documentation provides insights on optimizing WebViewer for mobile devices.
Responsive UI: Learn how to make WebViewer responsive to different screen sizes.
Hopefully, this helps you solve your problem while you wait for a human to get back to you.
Ensure that the WebViewer’s parent container is correctly set to flex or has a responsive design. Sometimes, setting the parent container to display: flex can help maintain proper scaling.
Check the viewport meta tag in your HTML file. Ensure it is set to <meta name="viewport" content="width=device-width, initial-scale=1.0"> to allow proper scaling on mobile devices.
In addition, we have an Angular sample you can reference:
thanks for your reply. I think I found the cause of the problem.
I wanted the Page control settings to be in the header of the viewer. Thats why I put following settings in the Webviewer instance:
However, I would still like to have the Page control settings directly inside the top header instead of the bottom of the view like default. Could you help me achieve that?
I was not able to reproduce the issue by adding that chunk of code to my project. As you can see in the image, it adds a flyout toggle button for the page controls at the bottom in my iPhone simulator. Since we don’t have a sample capacitor app, can you try reproducing this in Safari using our React sample?