• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How disable scrollbar when `embedMode: "FULL_WINDOW"`?

Explorer ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

How disable scrollbar when `embedMode: "FULL_WINDOW"`?

TOPICS
How to , PDF Embed API

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Sep 22, 2020 Sep 22, 2020

It is impossible to hide the scrollbar, but you can get the scrollbar size and count it:

function getScrollbarWidth () {

// Creating invisible container
const outer = document.createElement('div');
outer.style.visibility = 'hidden';
outer.style.overflow = 'scroll'; // forcing scrollbar to appear
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
document.body.appendChild(outer);

// Creating inner element and placing it in the container
const inner = document.createElement('div'
...

Votes

Translate

Translate
Community Expert ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

There is no programmatic control of the scroll bar at this time. What exactly are you trying to achieve? There might be a way to accomplish your goal in another way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

I want do this:
https://community.adobe.com/t5/document-services-apis/how-set-zoom-100/m-p/11442696#M683

and ultimately this:

https://community.adobe.com/t5/document-services-apis/pdf-embed-api-get-screenshot/m-p/11428290?page...

 

As for this topic, I can turn off the scrollbar or somehow to deduct it from the width of the container with the document (here comes the problem of recognizing whether the scrollbar is in the document at all).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

Let me try this another way. Assuming this is even possible, once you have the screen shot, what do you want to do with it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

1. I select a piece of text in the document.
2. I click "quote" button on my website (not in the viewer).
3. On the page (not in the viewer) there is a screenshot with the alt attribute with the quoted text, and under the screenshot there is a page number and a button that refers to a specific place in the document, and I can add a comment to this quote. The quoted text itself is not enough, because once it may have a different formatting than in the document and it will look different, and two, that there may be missing spaces, excessive spaces, etc. that would have to be manually corrected, and I want it all to be generated automatically .
4. I move quotes with comments anywhere, in the text, eg in the form of a blog or an article. This is not the same as the annotation comments visible in the side panel of the document, because it is supposed to be part of a blog/article and should be in the order I choose, with repeated citation of the same fragment, sometimes a paragraph with just a comment, grouping quotes and comments in sub-sections of the article.
5. Generate a blog/article page, with a built-in viewer call to see the context of the quote.

It is important to make it as easy as possible for the reader to get to the context of the fragment of the document quoted in the blog/article.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

1. I select a piece of text in the document.
2. I click "quote" button on my website (not in the viewer).
3. On the page (not in the viewer) there is a screenshot with the alt attribute with the quoted text, and under the screenshot there is a page number and a button that refers to a specific place in the document, and I can add a comment to this quote. The quoted text itself is not enough, because once it may have a different formatting than in the document and it will look different, and two, that there may be missing spaces, excessive spaces, etc. that would have to be manually corrected, and I want it all to be generated automatically.
4. I move quotes with comments anywhere, in the text, eg in the form of a blog or an article. This is not the same as the annotation comments visible in the side panel of the document, because it is supposed to be part of a blog / article and should be in the order I choose, with repeated citation of the same fragment, sometimes a paragraph with just a comment, grouping quotes and comments in sub-sections of the article.
5. Generate a blog / article page, with a built-in viewer call to see the context of the quote.

It is important to make it as easy as possible for the reader to get to the context of the fragment of the document quoted in the blog / article.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

Ok - If you want this all to happen on the client, you probably don't want to use Embed API and instead, use our Tools API to export the PDF to a series of images and build a UI around them to appear to be a PDF viewer. It'd be much easier to accomplish your goal that way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

It all can be done with Embed API, except take a screenshot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

Yes... but that's kind of a big part. But you can't take a screenshot from HTML at all. You can paint HTML into a <canvas> but that's not necessarily the exact same as the HTML that was rendered into a regular window.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 19, 2020 Sep 19, 2020

Copy link to clipboard

Copied

The Tools API has a problem that:
* I add annotation on the client side
* I am sending the pdf file to the server
* taking a screenshot of ALL document pages
* I cut and download the fragment of the page I need

 

Sending the entire PDF file (because in the Tools API I can't dynamically annotate, right?) And convert the ENTIRE FILE to images - it will all take a long time ... And this is supposed to be a click function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2020 Sep 21, 2020

Copy link to clipboard

Copied

I may not have been clear. My recommendation is to preprocess the PDF files into images and not use Embed API for this application at all. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 23, 2020 Sep 23, 2020

Copy link to clipboard

Copied

LATEST

But somehow I have to select some text from the document. Then view your annotated document. and i also want it to look the same in the screenshot and in the document.

 

If I find an alternative to Adobe PDF Embed API with annotations, I will be glad, but I found nothing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 22, 2020 Sep 22, 2020

Copy link to clipboard

Copied

It is impossible to hide the scrollbar, but you can get the scrollbar size and count it:

function getScrollbarWidth () {

// Creating invisible container
const outer = document.createElement('div');
outer.style.visibility = 'hidden';
outer.style.overflow = 'scroll'; // forcing scrollbar to appear
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
document.body.appendChild(outer);

// Creating inner element and placing it in the container
const inner = document.createElement('div');
outer.appendChild(inner);

// Calculating difference between container's full width and the child width
const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);

// Removing temporary elements from the DOM
outer.parentNode.removeChild(outer);

return scrollbarWidth;

}

source: https://stackoverflow.com/a/13382873/2908501

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources