Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:03:51+00:00 2026-06-13T01:03:51+00:00

As per title, is there any way I can parse pages from an unprotected

  • 0

As per title, is there any way I can parse pages from an unprotected PDF file as javascript Image() objects?

It would also be ok to convert them before running the javascript, but I would like this to be done automatically and without the assistance of any library which requires installation.

Someone over the internet has posted this Bash script. Unfortunately, I don’t know Bash but running it was very simple.

#!/bin/bash
PDF='doc.pdf'
NUMPAGES=`identify -format %n "$PDF"`

for (( IDX=0; IDX<$NUMPAGES; IDX++ ))
do
  PAGE=$(($IDX+1))
  convert -resize 1200x900 "$PDF[$IDX]" `echo "$PDF" | sed "s/\.pdf$/-page$PAGE.jpg/"`
done

echo "Done"

But I got these errors:

line 3: identify: command not found
line 5: ((: IDX<: syntax error: operand expected (error token is "<")

Pre-converting the PDF using a Bash script would be a good solution. Can someone fix the script above or either provide an alternative solution?

Many thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:03:52+00:00Added an answer on June 13, 2026 at 1:03 am

    PDF.js will let you render the PDF to a canvas. Then you can do something like:

    var img = new Image();
    img.src = pdfCanvas.toDataURL();
    

    I’ve been very impressed with PDF.js. I love letting the client’s browser do as much of the work for me as possible.

    Demo here: http://jsbin.com/pdfjs-helloworld-v2/1/edit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per the title, is there any way to programatically change the selected item
As per title, can an ActorContext extracted from within an actor be safely used
As per the title of the question, I’m wondering if there’s any mechanism to
As per title is there any difference passing a reference type to a method
As per title, can there ever be more than 1 \ char in a
As per the title, is there PHP equivalent of __name__ == __main__ ? Is
Using Visual Studio 2005 As per the title; MSDN and google can't tell me,
Is there any way to retrieve the match field/position for each keyword for each
Yes, the title is correct. Is there a way to code review a project
As per the title I have three parts to this question... Is db4o object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.