PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Discussions about PDF management.
Post Reply
schalla
Posts: 6
Joined: Tue Jan 14, 2020 5:11 pm

PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by schalla » 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: 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
[/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.
Attachments
StickyNote.JPG
Rubberstamp.JPG
Cance;.JPG

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by Hugo » Mon Feb 24, 2020 3:12 pm

Hi there,

Thank you for contacting us.

Please update to our latest version: https://www.gdpicture.com/download-gdpicture/ (v14.1.54)
We can't provide in depth support for outtdated versions as we may have already fixed this issue for our latest release.

We appreciate you submitting your code however it would be much more practical for us to reproduce the issue with a code project. This would save time in investigating this.

Please attempt to reproduce your issue using our latest version. If this problem persists please send us a ticket here: https://orpalis.zendesk.com/agent/
We respond there within 24hours.

Regards,

schalla
Posts: 6
Joined: Tue Jan 14, 2020 5:11 pm

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by schalla » Mon Feb 24, 2020 5:01 pm

Please don't close this ticket. Did you even understand what is the real issue before telling us to upgrade?
Was this an issue with the version we are using upgrading to 14.0.077? If yes please provide the SCR number. Please verify that it is a known version in 14.0.0.77. Thumbnail and viewer are not in sync somtimes.
Please understand we CANNOT upgrade to 14.1.54. We are not at the latest and greatest .net framework to upgrade to the latest and greatest GD Picture.

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by Hugo » Tue Feb 25, 2020 3:27 pm

Hi Schalla,

We have hundreds of minor versions and a new minor version released every 10 days or so. I cannot tell you if this issue was specific to GdPicture V9 or if it is still present in 14.0.77. Every minor update we fix numerous bugs and regularly add new features. This is why it would be best for you to use our latest version so we may better understand what you are referring to.
You don't need the very latest .NET framework. You can use .NET Framework v4.5 in our latest version for example. Please try this and let me know.

If you are absolutely certain v14.0.77 is the last version you are able to use then the support we provide is limited as mentioned before.

To fix potential issues with Viewer/ThumbnailEx images not displaying the latest iteration of your image you can use (for updating thumbnails) methods such as:
https://www.gdpicture.com/guides/gdpicture/GdP ... wItem.html
https://www.gdpicture.com/guides/gdpicture/GdP ... nails.html
Or you can use methods (For updating the viewer's displayed pages) such as:
https://www.gdpicture.com/guides/gdpicture/GdP ... edraw.html

I cannot answer your specific issue as it is too vague "Thumbnail and viewer are not in sync somtimes".

Lastly, this is a forum post, not a ticket. It will not be closed and anyone else is free to add a response in this thread.

Regards,

schalla
Posts: 6
Joined: Tue Jan 14, 2020 5:11 pm

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by schalla » Tue Feb 25, 2020 8:42 pm

Ok let me explain in detail
To be precise as showed in the three screenshots the viewer on the right and thumbnail on the left don't sync up
The sticky note appears on the thumbnail in the left but not on the viewer on the right (StickyNote.JPG)
Similarly the rubber stamp appears on the thumbnail and not on the viewer. (RubberStamp.JPG)
In this situation when I click on the cancel is when we get the empty viewer. (Canel.JPG)

I have an alternative meaning https://www.gdpicture.com/guides/gdpicture/GdP ... edraw.html
Adding this Redraw() helps after adding sticky note and rubber stamp. But Redraw might be a very costly operation if I were to redraw a big document about more than 100 pages. I would like to understand why redraw() was needed before adding this line of code. I tried with just redrawItem and didnt help. Thank you for looking at this.

This is the code to Add a sticky note, sticky note.

Code: Select all

 private void bciRubberStamp_CheckedChanged(object sender, ItemClickEventArgs e)
        {
            this.gdViewer1.HideTextEditBox(true);

            if (this.bciRubberStamp.Checked)
            {
                this.AddRubberStamp();
                this.gdViewer1_PageChanged();
//I  had the add the 2 lines below for the stamp to actually sync on both thumbnail and viewer
                this.gdViewer1.Redraw();
                this.thumbnailEx1.RedrawItem(this.DocumentImageViewModel.CurrentPageIndex);
            }
        }

Code: Select all

public void AddRubberStamp()
        {
            this.BeforeAnnotation();
            this.AnnotationManager.SelectPage(this.CurrentPageNumber);

            var color = Color.FromArgb(this.CurrentRubberStamp.Color);
            var left = (float)this.CurrentRubberStamp.LocationLeft.GetValueOrDefault();
            var top = (float)this.CurrentRubberStamp.LocationTop.GetValueOrDefault();
            var width = (float)this.CurrentRubberStamp.SizeWidth.GetValueOrDefault();
            var height = (float)this.CurrentRubberStamp.SizeHeight.GetValueOrDefault();
            var text = this.CurrentRubberStamp.DefaultText;

            var rubberStamp = this.AnnotationManager.AddRubberStampAnnot(color, left, top, width, height, text);

            rubberStamp.Subject = StringUtil.GetEnumDescription(AnnotationStyleTypes.RubberStamp);
            rubberStamp.Tag = Guid.NewGuid().ToString().ToUpper();
            rubberStamp.Opacity = (float)this.CurrentRubberStamp.Opacity.GetValueOrDefault();
            rubberStamp.CanMove = this.CurrentRubberStamp.IsMovable;
            rubberStamp.CanResize = this.CurrentRubberStamp.IsResizable;
            rubberStamp.CanRotate = this.CurrentRubberStamp.IsRotatable;
            rubberStamp.CanSelect = this.CurrentRubberStamp.IsSelectable;
            rubberStamp.Author = this.BuildAnnotationAuthors(rubberStamp.Author);

            this.SaveAnnotationsToPage(this.CurrentPageNumber);
            this.AfterAnnotation();
 
        }

Code: Select all

 #region SaveAnnotationsToPage

        private void SaveAnnotationsToPage(int page, bool burn = false)
        {
            
            this.AnnotationManager.SaveAnnotationsToPage();

            if (burn)
            {
                this.AnnotationManager.BurnAnnotationsToPage(true);
            }

            this.GdViewer.ReloadAnnotations();
            this.GdViewer.Redraw();
            this.ThumbnailEx.RedrawItem(page - 1);
        }

        #endregion

Code: Select all

#region AddStickyNote

        public void AddStickyNote()
        {
            this.BeforeAnnotation();
            this.AnnotationManager.SelectPage(this.CurrentPageNumber);

            var left = (float)this.CurrentStickyNote.LocationLeft.GetValueOrDefault();
            var top = (float)this.CurrentStickyNote.LocationTop.GetValueOrDefault();
            var width = (float)this.CurrentStickyNote.SizeWidth.GetValueOrDefault();
            var height = (float)this.CurrentStickyNote.SizeHeight.GetValueOrDefault();
            var text = this.CurrentStickyNote.DefaultText;

            var stickyNote = this.AnnotationManager.AddStickyNoteAnnot(left, top, width, height, text);

            stickyNote.Subject = StringUtil.GetEnumDescription(AnnotationStyleTypes.StickyNote);
            stickyNote.Tag = Guid.NewGuid().ToString().ToUpper();
            stickyNote.FillColor = Color.FromArgb(this.CurrentStickyNote.Color);
            stickyNote.Opacity = (float)this.CurrentStickyNote.Opacity.GetValueOrDefault();
            stickyNote.FontName = this.CurrentStickyNote.FontName;
            stickyNote.FontSize = this.CurrentStickyNote.FontSize.GetValueOrDefault();
            stickyNote.ForeColor = Color.FromArgb(this.CurrentStickyNote.FontColor.GetValueOrDefault());
            stickyNote.CanMove = this.CurrentStickyNote.IsMovable;
            stickyNote.CanResize = this.CurrentStickyNote.IsResizable;
            stickyNote.CanRotate = this.CurrentStickyNote.IsRotatable;
            stickyNote.CanSelect = this.CurrentStickyNote.IsSelectable;
            stickyNote.Author = this.BuildAnnotationAuthors(stickyNote.Author);

            this.SaveAnnotationsToPage(this.CurrentPageNumber);
            this.AfterAnnotation();

            Guid annotationId;
            var activity = new DocumentActivityDetail
            {
                SystemActivityTypeId = (int)SystemActivityTypes.AnnotationAdd,
                PageDescription = string.Format("on page {0} - {1}", this.CurrentPageNumber, stickyNote.Subject),
                TransactionId = Guid.TryParseExact(stickyNote.Tag, "D", out annotationId) ? annotationId : new Guid()
            };
            this.documentActivityDetailList.Add(activity);
        }

        #endregion

Code: Select all

#region AfterAnnotation

        private void AfterAnnotation()
        {
           
            this.GdViewer.LockViewer = false;
            this.ThumbnailEx.LockGdViewerEvents = false;
            this.ThumbnailEx.PauseThumbsLoading = false;
            this.ThumbnailEx.SelectItem(this.savedCurrentPageIndex);
            this.GdViewer.DisplayPage(this.savedCurrentPageIndex + 1);
            this.CurrentPageIndex = this.savedCurrentPageIndex;

            this.RestoreDisplayArea();
        }

        #endregion
Attachments
Rubberstamp.JPG

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by Hugo » Wed Feb 26, 2020 2:49 pm

Schalla,

I am only able to view the RubberStamp.JPG file you attached to your latest reply. Thank you for more accurately describing the issue.

Your code snippets are useful as they allow us to understand what you are doing however they do not allow me to reproduce the issue. A coe project would be ideal.

We have an issue to be solved and our to-do list which is intended to fix the display in thumbnails of annotations. This has not been solved yet but is due to be solved for our upcoming releases.
We have not had any issues as of recently with annotations displaying in the thumbnails and not in the viewer.

Would you be able to run our Annotation demo and see if you are able to replicate the problem there? ...\GdPicture.NET 14\Samples\WinForm\C#\Annotations


Even if we were to fix this issue for our latest releases this issue will still be present in our 14.0.77 version.
In order to correctly display annotations I suggest you burn your annotations BEFORE displaying them.

If you wish I can let you know of the progress we make on the issue to correctly display annotations in thumbnails.

Regards,

daisymaria
Posts: 1
Joined: Wed Feb 08, 2023 5:54 am

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by daisymaria » Wed Feb 08, 2023 5:59 am

I am unsure of the precise cause of the disappearance of PDF file thumbnails. I didn't set up or remove any software.
moto x3m

Hugo
Posts: 227
Joined: Tue Dec 18, 2018 10:09 am

Re: PDF Thumbnail and Viewer not in sync after upgrading to 14.0.0.77

Post by Hugo » Wed Feb 08, 2023 7:12 pm

Hi there,

For any specific issues with files, please contact us here: https://orpalis.zendesk.com/hc/en-us/requests/new
We'll investigate this more closely if there are any issues here.

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest