I'm using a collection of tabs to display PDF files. For example, I have two tabs open and the current document is scrolled to about mid document. Now I add a new document in a new tab. The new document and all others will scroll to the same spot as the previously active tab. I'd like to retain the position of documents in any open tabs while having the document in the new tab open to the top of the first page.
If I have multiple tabs open and documents scrolled to various positions they do not change simply switching from tab to tab. The change only occurs when adding a new tab.
Could you please provide more details about your setup?
Do you have a separate PDF Viewer for each tab, like this?
<TelerikTabStrip> @foreach (var doc in Documents) { <TabStripTab Title="@doc.Title"> <TelerikPdfViewer @key="doc.Id" Data="@doc.Data" /> </TabStripTab> } </TelerikTabStrip>
I am not very familiar with PDFSharp, so I looked it up. It seems that it does not provide a native Blazor component.
Achieving what you want might not be straightforward. You will likely need to store the scroll position of each PDF document before switching tabs. Then, when navigating back to a tab, you would retrieve and apply the saved scroll position to the PDFSharp viewer.
These interactions may require using Blazor JavaScript Interoperability (JS interop) to track and restore the scroll positions effectively.