Add SaveAsHandler for custom save as behavior
This pull request is a proposal for an extended functionality in the area of the 'save as' functionality.
Currently the saveAs function of the file-saver library is always triggered here. In some cases, it may be useful to implement this event individually in the context of customizing. E.g. in the context of a document management system, the result should not be saved locally but stored directly as a new file in the DMS. There can also be problems in the context of the IFrame attribute sandbox (IFrame in IFrame case).
See also: https://community.apryse.com/t/intercept-overwrite-download-function-in-webviewer/7245
WebViewer(...)
.then(function(instance) {
// data: Blob|File , filename: string
function saveAsHandler(data, filename) {
// Create download Link, Open Tab, call individual api
};
instance.UI.setSaveAsHandler(saveAsHandler);
});
Hi @uwohlfeil,
Thanks for making this PR! We will add this to our following sprint to review. Our next sprint starts next Monday. Once we have completed our review we will provide feedback.
Thanks for taking the time to submit this, you will hear from us soon.
I have added a few corrections in the area of the German translation:
Incorrect translations
- action.addMark and pageRedactModal.addMark
- old:
Markus hinzufügen - new:
Markieren(Long will beMarkierung hinzufügen, but we think that will break the layout) - action.insertBlankPageBelow
- old:
Leere Seite unten einfügen page - new:
Leere Seite unten einfügen"
- old:
- redactionPanel.clearMarked
- old:
Klar(Clear like clear water, clear view and so on) - new:
Abbrechen(cancel). The longer correct translation will be likeMarkierungen entfernen, but this may break the layout
Optimization
This translations are not wrong but we think they can be optimized.
- action.selectAll
- old:
Wählen Sie Alle(sounds like a command) - new:
Alle auswählen
- old:
- redactionPanel.redactionSearchPlaceholder
- old:
Hinzufügen nach Schlüsselwortsuche oder Mustern - new:
Schlüsselwortsuche oder Muster
- old:
- settings.lightMode
- old
Lichtmodusnot wrong but sound strange. The english version is very common in german - new
Light-Mode
- old
- settings.darkMode
- old
Dunkler Modusworks but we think the english version is very common in german - new
Dark-Mode
- old
- settings.advancedSetting
- old
Erweiterte Einstellung - new
Erweitertthis text fits better (but the original works but thenErweiterte Einstellungen)
- old
- settings.disableFadePageNavigationComponent
- old
Deaktivieren Sie die Seitennavigationskomponente ausblendensounds like a command - new
Seitennavigationskomponente nicht automatisch ausblenden
- old
- settings.disableToolDefaultStyleUpdateFromAnnotationPopup
- old
Deaktivieren Sie die Aktualisierung des Werkzeug-Standardstils aus dem Anmerkungs-Popup- Command - new
Aktualisierung des Werkzeug-Standardstils aus dem Anmerkungs-Popup deaktivieren"
- old
Ideas
The toolbar names are a little bit confusing and very long.
- option.toolbarGroup.toolbarGroup-FillAndSign
- old
Füllen und unterschreiben - new
Formular(Forms)
- old
- option.toolbarGroup.toolbarGroup-Forms
- old
Formen - new
Zeichnen(Draw/Sketch)
- old
We currently have the problem that the thumbnail multiselect checkbox input control is slightly shifted to the right. This makes it impossible to select the checkbox in the left part of the framed area. The problem seems to be the css rule "position: absolute". We suspect that our solution is not correct, but we hope that it shows the problem.
Before:

After:

Thank you for you feedback and additions! Most of this looks good. For the checkbox issue, we are working on implementing a fix already so you can leave the css change out for now. The only other changes would be to use
constinstead ofvarinvar handler = getSaveAsHandler();
@carlopdftron Thank you for your feedback and that you liked the changes. I tried to correct the noted points accordingly.