If a zoomToFitWidth configured annotation widget is resized (e.g. parent iframe resize) it will not fit the document to the new width.
If I click on the “Fit width” button in the toolbar after a resize the document keeps it’s old width.
If I call $("#annotation-widget").groupdocsAnnotation(“setWidth”, newWidth); on a window resize event the FitWidth works when I click the FitWidth button.
There seems to be no way to retrigger a “zoomToFitWidth” after a resize. There is only a “zoomIn”, “zoomOut” and “setZoom” parameter in JavaScript.
Is there a way to ensure the FitWidth functionality on resize?
If not, there should be one!
Hello,
Hello,
the annotation widget is embedded in an IFrame and instantiated with this code:
new WidgetFactory()
.Annotation()
.ElementId(“annotation-widget”)
.HighlightColor(0xfff600)
.StrikeOutColor(0xFF0000)
.EnableTextSelection(true)
.EnableTooltips(true)
.ShowPaging(false)
.ShowThumbnails(false)
.ZoomToFitWidth(true)
.EnableUndo(false)
.ShowFileExplorer(false)
.ShowToolbar(false)
.ClickableAnnotations(false)
.AccessRights(AnnotationReviewerRights.CanView | AnnotationReviewerRights.CanDownload | AnnotationReviewerRights.CanExport);
If the IFrame is resized, the GroupDocs-Wrapper (class=groupdocs_viewer_wrapper in DOM) fits that size, but not the content (class=inner doc_viewer in DOM). The content keeps it’s old size and adds scrollbars or stays shrinked (not full width).
That’s the issue I have with version 1.9.0.
Hello,
Hello Pavel,
sure I can. The annotation-widget is a div inside the IFrame (not called by src url) and I have a onResize event on the iframe window object (inside the iframe).
The Iframe has an absolute width that is changed by code outside the iframe (this will change the annotation-widget wrapper size, too).
But the real problem still is, that GroupDocs.Annotation 1.9.0 content will not auto fitWidth on an annotation-widget (wrapper) resize.
The content keeps it’s old width (with scrollbars added).
That’s bad. Is there a way around?
Hi again,
Hi,
that’s not necessary. Just use the current “GroupDocs.Demo.Annotation.Webforms” Projekt of the “GroupDocs.Annotation_2.1.0-NET-Examples.zip” examples.
Remove “.Width(600).Height(800)” from the widget and you will see that the content width will not fit, if you click “Fit width” after a browser resize.
The widget content keeps its initial width and gets scrollbars on smaller browser window and will only fit width to the initial width - not the current changed one.
Hi,