PDF search

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

PDF search

Post by Quinton B. » Wed Aug 01, 2018 6:38 am

What I'm trying to do is use a drop-down menu to quickly navigate to parts of a pdf in the browser widget without vail, any ideas?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: PDF search

Post by FourthWorld » Wed Aug 01, 2018 8:52 am

If the contents are also available in epub format this is easy. If you're stuck with PDF it's harder.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

montymay
Posts: 145
Joined: Thu Jul 18, 2013 5:23 am

Re: PDF search

Post by montymay » Fri Aug 10, 2018 10:09 am

As a followup to the previous post I would like to ask for a little bit more information about how one can search epub documents within LiveCode. My LC app is the front end for thousands of PDFs. I manually put data about each document into a SQLite database. A search for relevant PDFs is done by searching the database. I do not know how one can search the PDFs except by a program such as DTSearch. Converting PDFs to epub documents appears to be a possible alternative to my method.

Does one begin by converting the pdf to epub? Once you have a epub documents, can you navigate to a particular page as well as search the text? Do you search the epub document with LiveCode commands and functions? Can Boolean searches be done? Is there a online article about the process?

Thanks for any information.

Monty May

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: PDF search

Post by FourthWorld » Fri Aug 10, 2018 2:43 pm

Epub is a Zip-based format. LC includes an external for working with Zips.

To get started, grab any epub and change its file extension to ".zip", then double click it to let your OS unzip it. In the resulting folder you'll be able to see its contents. A quick search for details on epub format will tell you all you need to know from there.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: PDF search

Post by jameshale » Sat Aug 11, 2018 2:28 am

As Richard said, ePub is a renamed zip archive. The archive consists of xml, html, xhtml files with a few others depending on the nature of the book. There are no pages as such as the content needs to flow to fit the screen size of the reader. So searching an epub requires you to unzip the package and then loacate the text content (usually in a folder by itself) and then searching the enclosed files (sans tags).
I placed an epub reader on livecode share a while ago which describes the unpacking and reconstruction of an ePub 2 document, it opens and places the publication into arrays. Then you can do with it what you want. I think it was wriiten around LC 5 or 6 but should still work.
It was part of a personal project to read an ePub and then put it into an SQlite db so as to use the full text searching (simple, boolean, proximity etc) SQlite offers.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”