Hi Evgen,
Thank you for your help.
I get the HTTP 500 errors with
the original sample without modifications. I need to refresh one or two times
to get all JavaScript’s loaded properly. Sometimes all scripts fail to load and
sometimes a few are loaded correctly. The compile error regarding AnnoationServlet
occurs when I import the sample source code in eclipse and add the annotation
2.0 jar to the build path.
I was a bit unclear what I
want to achieve with opening a file directly. We have an application were we
want to give the user the possibility to annotate an uploaded document in a GWT
web application, therefore I would need to set the filename dynamically for
each request. At the moment I use the Script from the sample application.
var annotationWidget = $('#annotation-widget')
.groupdocsAnnotation(
{
localizedStrings : null,
thumbsImageBase64Encoded : undefined,
width : 1000,
height : 800,
fileId : '',
docViewerId : 'annotation-widget-doc-viewer',
quality : 100,
enableRightClickMenu : true,
showHeader : true,
showZoom : true,
showPaging : true,
showPrint : true,
showFileExplorer : true,
showThumbnails : true,
showToolbar : true,
openThumbnails : false,
zoomToFitWidth : true,
zoomToFitHeight : false,
initialZoom : 100,
preloadPagesCount : 0,
enableSidePanel : true,
scrollOnFocus : true,
strikeOutColor : '#00000c',
highlightColor : '#000017',
underlineColor : '#FF0000',
textFieldBackgroundColor : '#000041',
enabledTools : 8191,
connectorPosition : 0,
saveReplyOnFocusLoss : false,
clickableAnnotations : true,
disconnectUncommented : false,
enableStandardErrorHandling : true,
strikeoutMode : 1,
undoEnabled : true,
anyToolSelection : true,
tabNavigationEnabled : false,
minimumImageWidth : 0,
areaToolOptions : {
pen : {
width : 1,
color : -16711936,
dashStyle : 0
},
brush : {
color : -16711936
}
},
polylineToolOptions : {
pen : {
width : 1,
color : -65536,
dashStyle : 0
},
brush : {
color : -16776961
}
},
arrowToolOptions : {
pen : {
width : 1,
color : -65536,
dashStyle : 0
},
brush : {
color : -65281
}
},
distanceToolOptions : {
pen : {
color : -16776961
}
},
sideboarContainerSelector : 'div.comments_sidebar_wrapper',
usePageNumberInUrlHash : false,
textSelectionSynchronousCalculation : true,
variableHeightPageSupport : true,
useJavaScriptDocumentDescription : true,
isRightPanelEnabled : true,
createMarkup : true,
use_pdf : 'true',
_mode : 'annotatedDocument',
selectionContainerSelector : "[name='selection-content']",
graphicsContainerSelector : '.annotationsContainer',
userName : 'Anonymous',
userId : 'bc1a4493-521f-4c2c-94f7-540adfdf1805'
});
});
Is it possible to automatically generate a pdf with the current annotations after the user modified an annotation? What we want to do here is to immediately write back the modified document to our db table when a modification is made.
At the moment I am facing another problem. I have integrated the ViewDocument and LoadFileBrowserTreeServlet in our application, when I want to open a document via open file dialog, I get following stacktrace.
ionHandler|080-exec-7|15:19:07|ERROR| Annotation throws exception: null
com.groupdocs.annotation.exception.AnnotationException
at com.groupdocs.annotation.api.shared.CommonApi.viewDocument(Unknown Source)
at com.groupdocs.annotation.api.shared.WebApi.viewDocumentHandler(Unknown Source)
at com.groupdocs.annotation.handler.AnnotationHandler.viewDocumentHandler(Unknown Source)
at test.groupdocs.ViewDocumentServlet.doPost(ViewDocumentServlet.java:23)
Regards,
Martin