Issue
I want to pass a pdf URL to a html page's iframe with search parameter like below. My expectation is that on the html side the pdf opens with pointing to the first search result. But the pdf opens quite normal as the search parameter would not exist. I think it is discarded. What can I do?
C# code
TagService.Sys_VAR_iframe_source_pdf = "files/SysVar/Sysvar.pdf" + "#search=\"aaCurr\"";
html side
<iframe src=@TagService.Sys_VAR_iframe_source_pdf width="1500" height="800" frameborder="0"></iframe>
Solution
.pdf#search=
"A [or] B" was originally an Adobe URL construct for Internet Explorer, so you should need an Adobe PDF Acrobat plug-in to use it.
HOWEVER last time I tested MS Edge (Powered with Acrobat Light) it did not work. This has been a very very longtime open bug most recently covered at https://bugs.chromium.org/p/chromium/issues/detail?id=792647 most recent member related comment was "We won't." ??
You would need to use a Mozilla PDF viewer. Try this https://mozilla.github.io/pdf.js/web/viewer.html#search=%22A%20B%22
Whilst Firefox does respect that form of programming call, instigated End of 2012, finally released end of 2014! I would suggest for single word you avoid the \"
in your URL arguments, whilst testing.
try raw test as "files/SysVar/Sysvar.pdf#search=aaCurr"
NOTE
This behaviour also applies to several other #navigation "URL fragments" so this works in Firefox but not in Chromium's (although it should, as one of the "supported" URL fragments in 2013)! see this HTML search for 2017 list :-) https://bugs.chromium.org/p/chromium/issues/detail?id=64309#:~:text=Out%20of%20the%20requests%20in%20this%20bug%3A
NamedDest100-600.pdf#nameddest=500
Chromium's like Edge may work flakily with #page=[#] depending on user settings.
For PDF.js or Firefox PDF viewers see the fuller list here https://github.com/mozilla/pdf.js/wiki/Viewer-options
Answered By - K J
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.