Ticket T937728
Visible to All Users

How to enable a custom Save button when a PDF document has changes and should be saved

created 4 years ago

Hi,
I am using the PDFViewer to load and save a memory stream document which is a PDF fillable.

I created a "Save" button to handle my custom code, but I want to be able to enable/disable this custom "Save" button when the PDF document has changed in the PDFViewer.

I tried handling the PDFViewer.DocumentChanged() event but this event will only trigger when the document is being loaded.

What event should I use to check for the PDFViewer.IsDocumentChanged value to enable/disable my custom "Save" button when user enter any information in any of the PDF fields.

I am using VB.NET

Thanks!

Answers approved by DevExpress Support

created 4 years ago

Hello Edhy,
PdfViewer doesn't have an event that is raised when an end-user modifies a PDF document. You can create a timer and check the IsDocumentChanged property value on a timer tick. It's also possible to check this property on the Application.Idle event.
Should you have additional questions, feel free to contact me.

    Show previous comments (1)
    Maria Nikulina (DevExpress) 4 years ago

      You are welcome.

        Hi Mariya,

        we have the same requirement like Edhy.

        Are there plans to introduce such event or adding a "normal" save button on your side?
        For RichEditControl you have the following nice event

        Regards
        Dominik

        DevExpress Support Team 4 years ago

          Hi Dominik,

          While there is no built-in event to determine the moment when a document is changed, you can add a custom Save button to your project. Create a temporary variable, handle the PdfViewer.FormFieldValueChanged, PdfViewer.AnnotationChanged, PdfViewer.AnnotationCreated, and PdfViewer.AnnotationDeleted events, and change this variable value if a form field or annotation is modified.

          You can reset this variable value in the PdfViewer.DocumentChanged event handler.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.