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 7507137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:25:37+00:00 2026-05-29T22:25:37+00:00

I am considering using pdf.js (an open source tool that allows embedding of a

  • 0

I am considering using pdf.js (an open source tool that allows embedding of a pdf in a webpage). There isn’t any documentation on how to use it.

I assume what I do is make an html page with the script referenced in the header, and then in the body, I put some sort of function call with an array of the file name and location. Can anyone help me out here?

  • 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-05-29T22:25:38+00:00Added an answer on May 29, 2026 at 10:25 pm

    Try Google’ing pdf.js documentation

    /* create the PDF document */
    
    var doc = new pdf();
    doc.text(20, 20, 'hello, I am PDF.');
    doc.text(20, 30, 'i was created in the browser using javascript.');
    doc.text(20, 40, 'i can also be created from node.js');
    
    /* Optional - set properties on the document */
    doc.setProperties({
      title: 'A sample document created by pdf.js',
      subject: 'PDFs are kinda cool, i guess',        
      author: 'Marak Squires',
      keywords: 'pdf.js, javascript, Marak, Marak Squires',
      creator: 'pdf.js'
    });
    
    doc.addPage();
    doc.setFontSize(22);
    doc.text(20, 20, 'This is a title');
    doc.setFontSize(16); 
    doc.text(20, 30, 'This is some normal sized text underneath.');
    
    var fileName = "testFile"+new Date().getSeconds()+".pdf";
    var pdfAsDataURI = doc.output('datauri', {"fileName":fileName});
    

    NOTE: the “pdf.js” project mentioned here is https://github.com/Marak/pdf.js, and has been deprecated since this answer was posted. @Treffynnon’s answer is about the still-active Mozilla project (https://github.com/mozilla/pdf.js) that most searchers will be looking for.

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

Sidebar

Related Questions

I am considering using Maven for a Java open source project I manage. In
I am considering using the WebMail helper for sending email. Is there any way
I'm considering using the Google Contacts API for a webapp, but I'm worried that
We are considering using PhoneGap for an iPad application that we are developing. We
I'm considering using MongoDb for a backing store for a WPF app that I'm
I'm considering using mysql's built-in aes_encrypt . I normally use blowfish, but mysql doesn't
I'm considering using SQLite as a production database for a site that would receive
I'm considering using Sequel for some of my hairier SQL that I find too
Hi I'm considering using Python to make a watchdog app on Windows XP that
I've been considering using mmap for file reading, and was wondering how portable that

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.