I’ve migrated a desktop project from Xojo 2023 to 2025. In the 2023 version, an HTMLViewer with all Lock properties set to True would automatically zoom an embedded PDF to fit the control when the window was resized.
In the 2025 version, the HTMLViewer still resizes, but the PDF inside it no longer scales. It keeps its original size.
This behavior changed without any code modification. I’ve tried using ExecuteJavaScript to force a resize, but it doesn’t replicate the smooth, automatic “fit-to-window” behavior of the previous version.
Did anyone else experience this? Any ideas on how to restore the old functionality?
The issue with the javascript is that the browser likely isn’t using an embed tag to place the PDF.
Even if it was using one the problem is the pdf doesn’t size to fill the embed tag, at least not in tests on the mac. There is little control over the way the PDF renderer works within the HTMLViewer. Perhaps one of the plugin vendors has a better solution. You can try solutions out in here. Put the HTML below in and press the run button. Resizing the right panel fails to make the PDF widen.
HTMLViewer on macOS uses the Webkit engine that is the basis for Safari. Changes in that engine would easily account for this change, without Xojo doing a thing to change anything. I’m pretty sure Xojo doesn’t event distribute the webkit engine along with macOS applications, like it did with Windows. It simply relies on OS libraries.
If you place the HTML I provided into Safari you will find that the web browser works in the exact same fashion that you are now finding HTMLViewer to suffer. In other words changing the overall document width does not cause the PDF document within the page to change width also.