Closed IeuanWalker closed 1 year ago
I created PR #6 to fix this. When (if 😄 ) that PR passes, you'll be able to download a ZIP that has a NuGet package that you can use in your app:
@Eilon Sorry only just got time to pick this back up.
It's still an issue.
Looks like the check you added is looking at a different URL than the one set on MainFile -
The URL set on MainFile is MainFile="pdfjs/web/viewer.html?file=../../Dissertation.pdf"
Here is a repo - https://github.com/IeuanWalker/Maui.PdfViewer
Also from your PR i couldn't see where you re-add the query parameters
I'll take another look, thanks for checking!
@IeuanWalker I have a new attempt to fix this issue: #17
This adds a new StartPath
property that you can set to something like somefile.html?a=b&c=d
. Please note that the MainFile
property must be set to a specific file, which is what gets loaded if there is no other path specified (e.g. a request to /
).
So in your case you could probably do something like this:
<hwv:HybridWebView ... MainFile="pdfjs/web/viewer.html" StartPath="?file=../../Dissertation.pdf" />
And that will load the view.html
file as the default file, but the initial navigation will go to the particular query string with the PDF file specified.
Thanks @Eilon, will try and test it out now
Looks like its a different GitHub action than the last PR you built and no Artifacts were created
@Eilon just tried a bunch of stuff but getting this error logged in the console from the JS, which prevents the PDFViewer from working -
"Uncaught ReferenceError: require is not defined", source: https://0.0.0.0/viewer.js (580)
Using the Standard Maui webview i dont get this error and the PDF loads fine.
I've done a bunch of search, but cant see why this error would appear as its still using the standard Android.Webkit.WebView
Hi merged the PR, and the main build should produce artifacts in ~20min or so.
If you can create a repro project that uses the latest build and it still has the problem, please post that project and let me know so I can further investigate.
This control internally uses the same platform controls that the .NET MAUI WebView uses, but it configures it in a different way, so there could be some issues there that I will need to debug.
I'm currently building a PDF viewer using PDF.JS
Do to the URL having query string attached the
PlatformOpenAppPackageFile
doesnt ruturn a file -Example,
viewer.html
is the local PDF viewer, andfile=***
is the PDF file to load -viewer.html?file=https://www.syncfusion.com/downloads/support/directtrac/general/pd/GIS_Succinctly1774404643.pdf
viewer.html?file=Dissertation.pdf
Not quite sure how to get passed this issue.