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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:47:45+00:00 2026-06-09T20:47:45+00:00

I try to include fragments of pdf documents in a web page. These fragments

  • 0

I try to include fragments of pdf documents in a web page. These fragments are of different sizes. I want to display them in full in actual sizes.

I am looking to program in javascript something like:

<embed src="my_document.pdf#zoom=100" width="my_document.pdf".width height="my_document.pdf".height />

I do not know how to retrieve the document size in meta-datas of my document in javascript.

I have no problem to display the pdf. This code works but the 100% is 100% of the web page not the pdf document.

Is this possible?

  • 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-09T20:47:46+00:00Added an answer on June 9, 2026 at 8:47 pm

    You can’t do this with javascript

    Perhaps your able to get some meta-data like filesize, and file type (application/pdf) at best. ‘Unrolling’ the pdf contents to get a width/height isn’t really standard so I doubt it is even in the meta-data.

    Possible solution

    If your pdf documents contain text and have a layout where each page is of the same height AND you have access to the amount of pages there are in the pdf. If so you can add an attribute <embed page_type='A4' page_count='$page_count' .., which is accessable by javascript.

    An A4 paper would be 842px (let’s call it paper_height), so you can do something like pdf_height = paper_height * page_count * zoom;

    *Optional stuff *

    I am assuming the zoom is something custom, so you can add a javascript handler on it:

    $('embed').height(paper_height * zoom);
    
    // or
    
    $('embed').css('height', paper_height * zoom);
    

    However you might use some pre-defined CSS classes if the zoom does not have too many states. At the start you could do <embed class='pdf_height_no_zoom' ... And if the user clicks a zoom button $('embed').attr('class', 'pdf_zoom_level2');

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

Sidebar

Related Questions

I have a JSP page that will display the exact content of another web
I'm using Spring MVC. I want to include menu page (named menu.jsp) with a
When I create a new page in asp.net and try to include the master
I'm try include this plugin on my site, it's working fine but I am
When I try to include a file using include_once in php which shows warning
I'm using ASP.Net and whenever I create a script file or try to include
When I try to use #include CFIS_Main.h statement in form For_Student_Details.h, Its not accepting...Anybody
I try to compile code, that beggins with: #include<stdlib.h> #include<GL/gl.h> #include<glaux.h> with command: cc
I get Compiler Error C2248 when i try to compile the following code: #include
Here is example which I have try <?php include 'spider/classes/simple_html_dom.php'; $html = new simple_html_dom();

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.