PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77
Posted: Sat Feb 22, 2020 12:51 am
We are in the progress of upgrading from a very old version GDPicture 9 to 14.0.0.77
This is the code which hooks up the thumbnail to the viewer. See screenshot of how clicking on the cancel button has the viewer blank
It all looks good when loading. But when the cancel button is clicked the viewer and thumbnail don't sync up
[/code]
We are seeing other syncing issues when adding a rubber stamp, stick note, find next annotation
See the 3 screenshots of how 1) viewer is blank even though thumbnail one is highlighted 2) rubber stamp is on the thumbnail but not on the viewer c) stickynote is on the thumbnail but not on the viewer.
This is the code which hooks up the thumbnail to the viewer. See screenshot of how clicking on the cancel button has the viewer blank
It all looks good when loading. But when the cancel button is clicked the viewer and thumbnail don't sync up
Code: Select all
private void bbiCancel_ItemClick(object sender, ItemClickEventArgs e)
{
this.gdViewer1.HideTextEditBox(true);
using (new CursorManager())
{
var currentPageIndex = this.DocumentImageViewModel.CurrentPageIndex;
this.DocumentImageViewModel.SaveDisplayArea();
this.DocumentImageViewModel.CancelCommand.Execute();
this.DocumentImageViewModel.CurrentPageIndex = -1;
this.DocumentImageViewModel.CurrentPageIndex = currentPageIndex;
}
}
CancelCommand
if (this.DocumentFormat == GdPicture14.DocumentFormat.DocumentFormatPDF)
{
if (this.GdPicturePDF.LoadFromStream(this.DocumentStream) == GdPictureStatus.OK)
{
try
{
this.GdPicturePDF.FlattenFormFields();
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception) {} // Suppress error and continue
// ReSharper restore EmptyGeneralCatchClause
this.GdViewer.DisplayFromGdPicturePDF(this.GdPicturePDF);
}
}
this.ThumbnailEx.LoadFromGdViewer(this.GdViewer);
this.SetThumbnailItemText();
this.AnnotationManager.InitFromGdViewer(this.GdViewer)
Code: Select all
#region SaveDisplayArea
public void SaveDisplayArea()
{
var left = 0;
var top = 0;
var width = 0;
var height = 0;
this.GdViewer.GetDisplayedArea(ref left, ref top, ref width, ref height);
var area = new List<int>
{
left,
top,
width,
height
};
this.savedDisplayArea = string.Join(",", area);
this.savedZoom = this.GdViewer.Zoom;
}
#endregion
We are seeing other syncing issues when adding a rubber stamp, stick note, find next annotation
See the 3 screenshots of how 1) viewer is blank even though thumbnail one is highlighted 2) rubber stamp is on the thumbnail but not on the viewer c) stickynote is on the thumbnail but not on the viewer.