Copy link to clipboard
Copied
Good Morning,
Is is possible to access the search function in the Embed API programmatically? I would like to seed the search term and trigger a search automatically when the document is opened.
Thanks.
Yes, Seach API will be available very soon in Embed APIs. I am expecting it to be available as early as next month i.e. October.
Copy link to clipboard
Copied
At this time, there is no search API. Can you elaborate on your use case though, I think if we were to add that capability, your input would be valuable.
Copy link to clipboard
Copied
I would like to automatically scroll the user to a specific location within a PDF contract document: i.e. 'Section 5.2'.
Currently, I can do this by opening to the specific page in the PDF and then scrolling an apropriate number of pixels down that page. However, as the contract document is modified over time, the appropriate page and/or pixel scroll value will no longer be valid, but a text search for 'Section 5.2' would always get the user to the right spot so long as that text still exists.
If there are any other ways to jump / scroll to a specific destination with an embedded PDF, I would be interested to know.
Thanks
Copy link to clipboard
Copied
Ok - That's absolutely possible. We have recently gone to beta with an Extract API in the PDF Tools SDK. Extract will return a JSON object that contains the extracted text as well as the page and coordinates of that text area. You can leverage that JSON to drive an experience in the Embed API using the goToLocation API call. I'm developing a demo of exactly the use case you describe. If you contact me directly, I can show you what I have so far.
Copy link to clipboard
Copied
Hello,
I am wondering how you get an embedded pdf to open at a specific page - I have been trying to get it to work in this codepen - https://codepen.io/practicalPDF/pen/dyMzNqa but by adding ?page=2 or other number as directed in the comments doesn't seem to work. I'd like to provide an embedded pdf of a 400 page pdf that opens at a specific page depending on the link in the embed code.
Your insight is appreciated.
Thanks
Copy link to clipboard
Copied
Try this url https://codepen.io/practicalPDF/pen/dyMzNqa?page=2 - It's working for me.
That said, the code to go to a specific page is as follows
function goToPage(previewFilePromise, pageNum) {
previewFilePromise.then((adobeViewer) => {
adobeViewer.getAPIs().then((apis) => {
// Go to the page. Page numbers are 1 based.
apis.gotoLocation(parseInt(pageNum));
});
});
}
Copy link to clipboard
Copied
Oh Thank you... I understand now how it works! Very much appreciated 🙂
Copy link to clipboard
Copied
We also have a need for an entirely customized UI so the ability to control search entirely programatically would be great. This would hopefully include the ability to search and get back results with the location that we would jump to. If the document automatically highlights we would need a way to clear that when they are done searching. Happy to answer and more questions about our use case.
Copy link to clipboard
Copied
Yes, Seach API will be available very soon in Embed APIs. I am expecting it to be available as early as next month i.e. October.
Copy link to clipboard
Copied
Excellent!
Copy link to clipboard
Copied
I just wanted to update that Search API is a bit delayed. I am still sure that it will be avaiable soon but don't have an ETA yet.