Interrogate Your PDFs with Chrome AI / / No Comments Yesterday I blogged about using PDF.js and Chrome’s on-device AI to create summaries of PDF documents, all within the browser, for free. In that post I mentioned it would be possible to build a Q and A system so users could ask questions about the document, and like a dog with a bone, I couldn’t let it go. Last I built not one, but two demos of this. Check it out. Version One Before I begin, note that this version makes use of the Prompt API, which is still behind a flag in Chrome. For this demo to work for you, you would need the latest Chrome and the right flags enabled. The Prompt API is available in extensions without the flag and it wouldn’t surprise me if this requirement... more → Posted in: JavaScript Tagged with: Chrome, Interrogate, PDFs
Summarizing PDFs with On-Device AI / / No Comments You can take the man out of the PDFs, but you can’t take the PDFs out of the man. Ok, I’m not sure that exactly makes sense, but with a couple years in me of working with PDFs, I find myself using them quite often with my AI demos. For today, I’m going to demonstrate something that’s been on my mind in a while – doing summarizing of PDFs completely in the browser, with Chrome’s on-device AI. Unlike the Prompt API, summarization has been released since Chrome 138, so most likely those of you on Chrome can run these demos without problem. (You can see more about the AI API statuses if you’re curious.) Getting PDF Text – Client-Side There’s plenty... more → Posted in: JavaScript Tagged with: OnDevice, PDFs, Summarizing
Adding PDFs to Your Webpage without JavaScript / / No Comments Edited at 4:03PM to add a small note to the end. In my time at Adobe, one of the products I evangelized was the PDF Embed API, a JavaScript library for adding PDFs to a web page. I still recommend this library of course, but I was thinking this morning about how you could get similar results without JavaScript. Remember, you are allowed to build a web page and not ship any JavaScript. It’s ok, I won’t tell. Before looking at what I built, some context to why someone would use a library like Adobe’s PDF Embed: Browser’s have great built-in PDF support, natively, but the display is typically the entire page, which means you lose the context of the rest of your site. There’s... more → Posted in: JavaScript Tagged with: Adding, JavaScript, PDFs, Webpage, without
Using Cloudflare’s AI Workers to Add Translations to PDFs / / No Comments Late last month, Cloudflare announced new AI features in their (already quite stellar)Workers platform. I’ve been a big fan of their serverless feature (see my earlier posts) so I was quite excited to give this a try myself. Before I begin, I’ll repeat what the Cloudflare folks said in their announcement: "Usage is not currently recommended for production apps". So with that in mind, remember that what I’m sharing today may change in the future. The Demo # Before I get into the code, let me share what I’ve built. Now, at the time I wrote this, Cloudflare’s AI stuff was still in beta and there is no cost yet for using the features. This is, obviously, going... more → Posted in: JavaScript Tagged with: Cloudflare's, PDFs, Translations, using, workers