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

Encountering Several bugs with the Embed Api

Community Beginner ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

I'm using the Embed Api and getting hung up on a few bugs:

Text Selection Tools

The text selection tools only show up intermittently

  • A lot of the time when text is selected the tools never show up in order to make a highlight I attached a video showing the behavior

Expectations:

I would expect the selection tools show up after selecting text all the time

 

Annotation Manager:

getAnnotations and removeAnnotationsFromPDF fail with message: "Invalid time value"

It seems that there are particular annotations that are corrupting things, but I don't see why the entire operation should fail.

 

Expectations

- I would expect that getAnnotations would only return valid annotations 

- I would expect that removeAnnotationsFromPDF to remove all annotations regardless if some have corrupt data or not

 

TOPICS
PDF Embed API

Views

1.7K

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
Adobe Employee ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

Sorry to hear that you're facing these issues. Would be super helpful if you could share the following information.

 

1. Text Selection Tools: Do you see the issue always or intermittently? Is it specific to the PDF file used in the recording? Would it be possible to share the PDF file so we can take a look.

 

2. Annotation Manager: Can you share any such example annotation data which shows this error? Or the PDF file containing such annotation data.

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 Beginner ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

Sure thing.  I've attached two documents named accordingly.

 

The text selection happens intermittently on many pdfs, but this one it seems to happen more consistently.

 

The malformed annotations pdf, I tried to remove all annotations with Adobe Acrobat Pro, however there are several annotations that just continue to re-appear.  Either way, one of them has a malformed date that seems to break several of the embed annotation api calls.

 

Thanks for the help.

 

Colter

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
Adobe Employee ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Hello,

Wanted to share the following update:

 

1. Text Selection Tools: Unfortunately, we haven't been able to reproduce the first issue. Could you share some more details, like the OS and browser versions where you see the issue. Is there any hosted site with the PDF which you can share with us so we can try reproducing the issue on that website. 

 

2. Annotation Manager: The PDF contains a couple of annotations with invalid date format which is causing the annotation APIs to fail. We have taken note of the issue that few corrupt annotations should not fail the entire operation. We have added this to our product backlog and will consider for future enhancements. Thanks for the feedback.

I can think of a workaround where you can set the configuration variable includePDFAnnotations: false. In this case, all annotation APIs will work as expected but you won't be able to access any of the existing saved annotations in the PDF. For more details, please see the section Comments and Markup -> Annotations API overview in the documentation.

 

Hope this helps. Thanks!

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 Beginner ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Thanks for the update!

 

Thanks for adding the issue to the backlog.  So as it stands, it's not necessarily going to get fixed?  It seems more like a bug than an enhancement, so hopefully it can get placed into one of your upcoming sprints.

 

I will try to see if the text selection issue is caused by the code that I have written.  One thing that I'm trying to do for a client (and have been able to do with some work arounds) is allow them to create highlight annotations where the selected text is automatically copied into the body of the annotation.  Apparently this was possible with Adobe Pro and they needed this capability in their new application.  Unfortunately, there doesn't seem to be a good way to get the text selection of a highlight annotation.  It would be great if there was an easy way to do that but alas, I've had to resort to a few work arounds to get it to work.  If you have any thoughts on this, that'd be great.

 

 

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 Beginner ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

To add some additional details for you.  I have narrowed down that it's my code that is causing problems but I'm uncertain why.  

 

I am trying to use the PREVIEW_SELECTION_END event in conjuction with the previewApis to getSelectedContent in order to get the current selected content after it has been selected (since the PREVIEW_SELECTION_END event only returns quadpoints / bounding boxes that cant be referenced back to content).

 

It would be ideal for the PREVIEW_SELECTION_END to also return back the current selected content.  I think it would make that event more useful since the bounding boxes that are returned currently can't be used to determine the content that they refer to.

 

// ... more initialization code above    

const previewApis = await preview.getAPIs();
const viewEventHandler = (evt: AdobeDC.ViewCallbackResponse) => {
  console.log("SELECTION END", evt);
  // the following line is causing problems
  previewApis.getSelectedContent().then(({ data: selectionData }) => {
     console.log("selection Data", selectionData)
  });
}

adobeSdk.registerCallback("EVENT_LISTENER",
  viewEventHandler, {
    listenOn: [
       "PREVIEW_SELECTION_END"
    ],
    enableFilePreviewEvents: true
});

 

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 Beginner ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

To add some additional information.  On a hunch I added a delay which fixed the problem.  So it seems that there is a bit of a race condition happening some where.  Anyways, adding a setTimeout with 100ms within my event handler fixed the problem.

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 Beginner ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

@Sumona Ghosh Is there any timeline / ETA on the bug fix for the annotation api?  I've also encountered a few other bugs, is this forum the best way to get someone to look at them?

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 Beginner ,
Aug 22, 2021 Aug 22, 2021

Copy link to clipboard

Copied

@Sumona Ghoshjust following up on this.

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
Adobe Employee ,
Aug 25, 2021 Aug 25, 2021

Copy link to clipboard

Copied

@Colter McQuay Hello!

You can share the issues you're facing on this forum itself and we will take a look.

Thanks. 

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 Beginner ,
Aug 25, 2021 Aug 25, 2021

Copy link to clipboard

Copied

@Sumona Ghosh There's a different forum for sharing issues?  Or are you talking about this forum?  I've left a few different issues but haven't heard anything back.  If the Embed Api was open source I'd just fix it myself and issue a PR, but unfortunately only Adobe can fix them.

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 Beginner ,
Sep 01, 2021 Sep 01, 2021

Copy link to clipboard

Copied

@Sumona Ghosh Any updates on this one?  I've posted a few more issues that I've come across.  Unfortunately, the application that I've built for my client is blocked by the issues that I've found so the only thing I can do at this point is to pray 🙏  that someone from Adobe fixes one of them.  The other issues are:

 

What appears to be a memory leak:
https://community.adobe.com/t5/document-services-apis-discussions/memory-leak-in-embed-api/m-p/12356...

 

Bug in the storage / updating of existing annotations:

https://community.adobe.com/t5/document-services-apis-discussions/embed-api-updated-annotations-are-... 

 

I'm happy to provide any extra details on any of these.  

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 Beginner ,
Sep 13, 2021 Sep 13, 2021

Copy link to clipboard

Copied

@Sumona Ghosh Any updates?

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
Adobe Employee ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

Hi @Colter McQuay , the annotation API bug fix will be taken up in the upcoming releases. It is already added to the product backlog.

 

Thanks!

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
New Here ,
Jun 09, 2022 Jun 09, 2022

Copy link to clipboard

Copied

LATEST

Is there any update on this. I am trying to annotate a PDF which already has annotations which results in:

{
     code: "FAIL",
      message: "Invalid time value"
}

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