Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation and comment empty text field #113

Open
ozierau opened this issue May 20, 2019 · 7 comments
Open

Annotation and comment empty text field #113

ozierau opened this issue May 20, 2019 · 7 comments
Labels
bug HummusJS Hummus JS related Next Patch next patch version

Comments

@ozierau
Copy link

ozierau commented May 20, 2019

Hey all,

I want to annotate or comment some positions. With the code below the annptations are visible in adobe but without the assigned text.

const edit: Recipe = hummusRecipe.editPage(1);
      // tslint:disable-next-line:no-increment-decrement
      for (let index: number = 0; index < interactions.length; index++) {
        const interaction: IInteraction = interactions[index];
        const slide: ISlide = interaction.to.asset as ISlide;
        console.log(interaction);
        edit.comment('Test', 300, 400).text('Test', 200, 300).annot(300, 600, 'Caret', {
          title: 'Test',
          width: 300,
          height: 300,
          flag: 'readonly'
        });
        /**
         * 
         */
      
        
      }
edit.endPage().endPDF();

Bildschirmfoto 2019-05-20 um 13 26 53

Anyone knows the problem? Thanks in advance!

@shaehn
Copy link
Collaborator

shaehn commented May 20, 2019

I am finding that a simple .comment call which uses the hummus createPDFTextString call is failing. The returned values are always empty. This has got to be a hummus library issue. I logged the following issue there.

galkahana/HummusJS#389

@shaehn shaehn added bug HummusJS Hummus JS related labels May 20, 2019
@ozierau
Copy link
Author

ozierau commented May 20, 2019

Thanks @shaehn, tried 103 with no luck.. going back until 101

@ozierau
Copy link
Author

ozierau commented May 20, 2019

@shaehn not working with hummus js v1.0.101 and hummus-recipe v1.8.6

@ozierau
Copy link
Author

ozierau commented May 21, 2019

FIX: Updated hummus recipe annotations.js with the following:
Instead of doing

.writeKey('T')
        .writeLiteralStringValue(this.writer.createPDFTextString(params.title).toBytesArray())

i changed it to:

.writeKey('T')
        .writeLiteralStringValue(params.title || '')

and it worked.

Also the hummus recipe documentation forgot to add annotation.options.text as a possibility.

@chunyenHuang chunyenHuang added the Next Patch next patch version label Jun 10, 2019
@ghost
Copy link

ghost commented Nov 5, 2019

Hey @chunyenHuang. Thanks for your efforts. Is this implemented? I am having this same issue with the latest version

@chunyenHuang
Copy link
Owner

Updated, thanks for the helps guys.

@ghost
Copy link

ghost commented Nov 6, 2019

hey!

I just pulled the latest and still having no luck can any else confirm this? Basically its setting all the options and the coords of the annotation but the annotation is empty still. I had a look at the hummus library but have not really seen any issues with this.

shaehn added a commit to shaehn/hummusRecipe that referenced this issue Nov 6, 2019
I got rid of all references to the broken hummus.createPDFTextString function and just used the straight text reference
chunyenHuang added a commit that referenced this issue Nov 12, 2019
Fix for missing text in annotation #113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug HummusJS Hummus JS related Next Patch next patch version
Projects
None yet
Development

No branches or pull requests

3 participants