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

Readonly mode #4

Open
Inetsis opened this issue Feb 5, 2020 · 4 comments
Open

Readonly mode #4

Inetsis opened this issue Feb 5, 2020 · 4 comments

Comments

@Inetsis
Copy link

Inetsis commented Feb 5, 2020

Can you add a 'read only' mode ?

  • no annotation
  • no save
  • no popup
  • etc ..
@fibbo
Copy link
Contributor

fibbo commented Feb 10, 2020

@Inetsis this is already possible.

To disable annotations and popups set add following option to the options object

modules: [
DebugModule,
PopupModule,
TextAnnotationModule,
InkAnnotationModule,
FreetextAnnotationModule,
HighlightAnnotationModule,
StampAnnotationModule,
],

modules: []

Since annotations and popup are modules they can be disabled by explicitly removing them from the modules list of the options.

Saving can also be disabled via options (allowSaveFile: false).

But I like the idea of an encompassing read-only option, I will bring this up with the team.

@Inetsis
Copy link
Author

Inetsis commented Feb 10, 2020

Hello

Thanks for your reply
I have already try to set a empty array to modules with options, and it don't work
I finally find a solution doing this :

this.viewer.viewerCanvas.viewLayers.splice(2, 2);

It remove AnnotationSelectionLayer and TextSelectionLayer
It's quite bad, but is the one way i found ...

Looking forward to reading you

@fibbo
Copy link
Contributor

fibbo commented Feb 10, 2020

If you say it doesn't work - what doesn't work? The viewer fails to instantiate or it's not the read only mode you want?

Btw, to be eligible for support during evaluation can you please register an account on www.pdf-tools.com?

@Inetsis
Copy link
Author

Inetsis commented Feb 10, 2020

If I set a empty array on modules options, the viewer start with all modules as if I done nothing.
I'have already a support, I'm wokring with Didier Leclerc in ProSoftTools team, I have already contacted "Feride" with mail, he gave me the github url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants