Request for Enhanced Touch Experience

Hello everyone, I've been using PDFViewer and encountered a few issues that I need help with:

1. When using touch input, pinch-to-zoom gestures on a PDF often cause the application to crash. This issue doesn't occur when using a mouse.

2. Deleting ink annotations while using touch input leads to the app crashing. Here are the specific steps to reproduce the issue:
   1. Click the "Open PDF" button and open any PDF file.
   2. (Optional) Pinch-to-zoom the PDF using touch input.
   3. Click "Ink Annotation" and draw any ink annotation.
   4. Check the "Delete Annotation" checkbox.
   5. Select and delete a few ink annotations.
   6. At this point, the app may crash immediately, or the ink annotations may be removed but the selection box remains. Clicking on another ink annotation will then cause the app to crash.

3. When printing a PDF, if I don't choose "Silent Print," a dialog box will pop up. In this dialog box, there is an option called "Print to File." When I check this box, another "Save As" dialog appears. I would like to set the filename in this dialog to the value of PrinterSettings.DocumentName, but I don't know how to do this. I would appreciate your help.

4. I would like to automatically save a PDF with ink annotations when a user leaves the page. Is there a way to determine if ink annotations exist on a PDF?

Attachment: Syncfusion_PDF_6ac9a105.zip

21 Replies 1 reply marked as answer

MS Manigandan Shanmugam Syncfusion Team July 10, 2023 02:44 PM UTC


Rhyme,


1. When using touch input, pinch-to-zoom gestures on a PDF often cause the application to crash. This issue doesn't occur when using a mouse.

We are not able to reproduce the reported issue on our end with the provided details. We have attached a video which we tried to reproduce the reported issue. We request you to kindly share the document that you have used, Syncfusion NuGet version and the detailed replication steps. This will help us to investigate further on this.

 

2. Deleting ink annotations while using touch input leads to the app crashing. Here are the specific steps to reproduce the issue:

   1. Click the "Open PDF" button and open any PDF file.

   2. (Optional) Pinch-to-zoom the PDF using touch input.

   3. Click "Ink Annotation" and draw any ink annotation.

   4. Check the "Delete Annotation" checkbox.

   5. Select and delete a few ink annotations.

   6. At this point, the app may crash immediately, or the ink annotations may be removed but the selection box remains. Clicking on another ink annotation will then cause the app to crash.

With the provided details, the reported issue “Selection is not disabled when we delete ink annotation using touch interaction” can be reproduced on our end. We will analyze and update the further details on July 12, 2023.

3. When printing a PDF, if I don't choose "Silent Print," a dialog box will pop up. In this dialog box, there is an option called "Print to File." When I check this box, another "Save As" dialog appears. I would like to set the filename in this dialog to the value of PrinterSettings.DocumentName, but I don't know how to do this. I would appreciate your help.

In our WPF PDF Viewer, as we are using the MSDN print internally, we can’t be able to set the document name in the save as dialog box as it was handled by the `Microsoft Print To PDF` printer. This was the default behavior of the `Microsoft Print To PDF` printer. You can also check this behavior while printing in adobe and chrome.

4. I would like to automatically save a PDF with ink annotations when a user leaves the page.

We can save the PDF document, when we leave the page with making any changes on the ink annotation, this can be achieved by using PdfViewer_InkAnnotationChanged event. Please find the attached link about the ink annotation changed event. Also, we have attached the code snippet for your reference.

 

 

        private void PdfViewer_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e)

        {

            MemoryStream stream = new MemoryStream();

 

            pdfViewer.LoadedDocument.Save(stream);

 

            pdfViewer.Load(stream);

        }



Is there a way to determine if ink annotations exist on a PDF?

Yes, we can find the whether the ink annotation is present in the pdf document or not by using the following code snippet in the PdfViewer_DocumentLoaded event.


        private void PdfViewer_DocumentLoaded(object sender, EventArgs args)

        {

            bool isinkPresent = false;

 

            for (int i = 0; i < pdfViewer.LoadedDocument.Pages.Count; i++)

            {

                for (int j = 0; j < pdfViewer.LoadedDocument.Pages[i].Annotations.Count; j++)

                {

                    if (pdfViewer.LoadedDocument.Pages[i].Annotations[j] is PdfLoadedInkAnnotation)

                    {

                        isinkPresent = true;

                    }

                }

            }

        }


Attachment: Video_861d3708.zip


RH Rhyme replied to Manigandan Shanmugam July 11, 2023 12:46 AM UTC

Hello Manigandan,


Thank you for your response. Regarding the first issue, I admit that it's difficult to reproduce, and it seems to only occur on computers with insufficient memory. When I encounter this problem again, I will record a screencast and send it to you.


As for the second issue, I look forward to your further analysis and resolution. I will continue to monitor the situation.


Concerning the third issue, is it possible for me to call MSDN to print and set the document name in the "Save As" dialog box? If so, I would appreciate it if you could provide me with an example code.


The other issues have been resolved, and I thank you for your assistance.



MS Manigandan Shanmugam Syncfusion Team July 11, 2023 01:48 PM UTC

Hi Rhyme,

Thank you for your response. Regarding the first issue, I admit that it's difficult to reproduce, and it seems to only occur on computers with insufficient memory. When I encounter this problem again, I will record a screencast and send it to you.


Thanks for the update. If the issue was reproduced again on your end, please share the below mentioned details also with the recorded screencast.

  • System specifications.

  • Syncfusion WPF Pdfviewer NuGet version

  • Visual studio version.

  • .NET\.NET Framework version

  • Project environment(32-bit/64-bit)

  • Used document if it is document specific.

  • Stack trace if any.

As for the second issue, I look forward to your further analysis and resolution. I will continue to monitor the situation.


As we said earlier, we will update further details on July 12, 2023.


Concerning the third issue, is it possible for me to call MSDN to print and set the document name in the "Save As" dialog box? If so, I would appreciate it if you could provide me with an example code.


The DocumentName property of the printer settings is used to pass information about the document name of the print document. Additionally, since the "Microsoft print to pdf" printer receives the printed document information and shows its own save as dialogue, we can't customize the dialogue box's file name.




KG Krithika Ganesan Syncfusion Team July 12, 2023 01:58 PM UTC

We have confirmed the issue “Selection is not disabled when we delete ink annotation using touch interaction" as a defect in our product and we will include the fix into our upcoming weekly NuGet release on 25th July 2023.

 

Please use the below feedback link to track the status of the reported bug.

https://www.syncfusion.com/feedback/45230/selection-is-not-disabled-when-we-delete-ink-annotation-using-touch-interaction

 

Note: If you require a patch for the reported issue in any of our Essential Studio Main or SP release version, then kindly let us know the version, so that we can provide a patch in that version based on our SLA policy.

 

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”



RH Rhyme replied to Krithika Ganesan July 13, 2023 01:32 AM UTC

Hello Krithika,

I'm glad to hear that you're willing to address the issue I've encountered.
Additionally, I've noticed that the lock annotation feature doesn't seem to work as expected;
perhaps I'm doing something wrong. Here are the steps I've followed:

  1. Open any PDF
  2. Select the Ink Annotation tool and create an annotation
  3. Choose Locked Annotation; at this point, the annotation should be locked
  4. However, I can still select and move the annotation


Attachment: Syncfusion_PDF_6ae52de9.zip



MS Manigandan Shanmugam Syncfusion Team July 13, 2023 10:59 AM UTC

Hi Rhyme,

We have investigated the reported issue with the sample you have provided. This was occur due to sample level code, in which IsChecked property of the "delete" annotation checkbox was used instead of the "lock" annotation checkbox. Please find below modified code snippet and also attached a modified sample for your reference.

var isLocked = LockedAnnotation.IsChecked == true;


Attachment: Syncfusion_PDF_6ae52de9_9242d56a.zip


RH Rhyme replied to Manigandan Shanmugam July 14, 2023 12:50 AM UTC

Hello, Manigandan. Thank you for your response. I have used the attachment provided in your reply, but it seems that the issue of being able to select and move the ink is still present. Could this be due to my own mistake?

1.PNG

2.PNG

3.PNG



KG Krithika Ganesan Syncfusion Team July 14, 2023 01:11 PM UTC

Hi Rhyme,


When we update default annotation settings it will work for annotation, which are going to add but it won’t work for existing annotations in the loaded document. In order to achieve your requirement, to lock all ink annotations present in the document. We can set lock property for the selected annotation using  annotation change event. Please find the below code snippet and sample, which will set lock property of  any of the selected ink annotations based on the checkbox value.


private void PdfSyncfusionDocument_InkAnnotationChanged(object sender, InkAnnotationChangedEventArgs e)

{

     if (e.Action == AnnotationChangedAction.Select && DeleteAnnotation.IsChecked == true)

     {

          SyncfusionSingle.Instance.PdfSyncfusionDocument.DeleteAnnotation(e.Name, e.PageNumber);

     }

     else if (e.Action == AnnotationChangedAction.Select)

     {

          e.Settings.IsLocked = LockedAnnotation.IsChecked == true;

     }

}


Attachment: Sample_53daf5bf.zip


RH Rhyme replied to Krithika Ganesan July 16, 2023 03:14 AM UTC

Hello, Krithika. Thank you for your prompt response. The added comments can now be fixed in place. I have another query. Is it possible to make the ink not selectable (without a selection box) and then revert it back to a selectable state after unlocking?



MS Manigandan Shanmugam Syncfusion Team July 17, 2023 04:15 PM UTC

Hi Rhyme,

As per your requirement, we have analysed and determined that we are not able to disable the selection of annotations using the locked feature in WPF PdfViewer. However, we have created a workaround sample to achieve your requirement to disable the selection of annotations by using the flatten property of the PdfLoaded document, which is attached below for your reference. 


In this sample, when we checked the locked annotation check box, we were flattening all the annotations present in the document. While flattening the annotations, they were drawn as a graphic, so we couldn't select or modify them. And when we unselect the locked annotation check box, we reload the original documents, which are already saved. Also, we have handled saving the newly added annotations to the original documents, which were added at the time of flattening.


Attachment: sample_7545f1d6.zip


RH Rhyme replied to Manigandan Shanmugam July 18, 2023 01:17 AM UTC

Thank you, Manigandan. I used the sample code you provided and found that locking and unlocking causes ink strokes to be lost. Since I cannot disable comment selection using the lock feature in the WPF PdfViewer, I will make some adjustments on my end to prevent the program from crashing.


Additionally, I'd like to mention that when annotations are selected during touchscreen operations, occasionally the PDF is unable to zoom in or out even if the user clicks on a blank area next to the annotation. If possible, please assist in resolving this issue.



RB Rajavignesh BalaSankar Syncfusion Team July 18, 2023 02:39 PM UTC

Rhyme, please find the details for your queries in the below table.

I used the sample code you provided and found that locking and unlocking causes ink strokes to be lost. Since I cannot disable comment selection using the lock feature in the WPF PdfViewer, I will make some adjustments on my end to prevent the program from crashing.

As we said earlier, the lock feature of WPF PdfViewer disables only the property changes and the selection won’t be disabled. The ink stroke was removed as we have missed to maintain the original document properly. We have modified the sample and attached below for your reference.

Additionally, I'd like to mention that when annotations are selected during touchscreen operations, occasionally the PDF is unable to zoom in or out even if the user clicks on a blank area next to the annotation. If possible, please assist in resolving this issue.

Since, this was a new query, we have splitted this one as a new forum to avoid misunderstanding. Please follow this query in the below mentioned forum link,
https://forumassist.syncfusion.com/183537


Attachment: Sample_53daf5bf_39a021b2.zip


RH Rhyme replied to Manigandan Shanmugam July 20, 2023 12:50 AM UTC

Hello Manigandan,


As I mentioned before, there has been an issue where the pinch-to-zoom gesture causes the application to crash.


I had one of my colleagues assist in confirming this issue. Interestingly, he didn't come across any crashes related to the pinch-to-zoom gesture. Instead, he discovered that occasionally a null reference exception occurs when opening a PDF.


I must apologize, as my colleague does not have development experience and is not particularly proficient at computer operations. He can only review the application's logs when an error occurs. According to the log information, it appears that the null reference is caused by UpdateOffset.


I've captured the relevant error information in a screenshot. If there are any points that require further clarification, I'll provide as much assistance as I can.


1 (1).png



MS Manigandan Shanmugam Syncfusion Team July 20, 2023 01:58 PM UTC

Hi Rhyme,

We are unable the reproduce the reported issue on our end. We suspect that the reported issue occurred with the specific PDF document used. If it is possible for you to share the PDF document which you have used to reproduce the reported issue and it will be helpful for us to reproduce the problem on our end.



KG Krithika Ganesan Syncfusion Team July 25, 2023 11:17 AM UTC

Hi Rhyme,


2023 Volume 2 SP Release has been planned for this week, so we will not be having a weekly release this week (July 25, 2023). So, we have created the patch fix in the version 22.1.34.

The reported issue “Selection is not disabled when we delete ink annotation using touch interaction" has been fixed and the patch for this fix can be downloaded from the following location. We have created the patch with essential studio version 22.1.34.


Recommended approach - exe will perform automatic configuration. 

Please find the patch setup from below location: 

https://syncfusion.com/Installs/support/patch/22.1.34/1571619/F183376/SyncfusionPatch_22.1.34_1571619_7252023060356128_F183376.exe

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment. 

Please find the patch assemblies alone from below location:

https://syncfusion.com/Installs/support/patch/22.1.34/1571619/F183376/SyncfusionPatch_22.1.34_1571619_7252023060356128_F183376.zip

Nuget:

https://syncfusion.com/Installs/support/patch/22.1.34/1571619/F183376/SyncfusionNuget_22.1.34_1571619_7252023060356128_F183376.zip

Assembly Version: 22.1.34

Installation Directions : 

This patch should replace the files “Syncfusion.Pdf.Base,Syncfusion.PdfViewer.WPF” under the following folder. 

$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6 

Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0 


To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies. 


Note : 

You can change how you receive bug fixes by navigating to the following link and updating your preferences. 

https://www.syncfusion.com/support/directtrac/patches


Disclaimer : 

Please note that we have created this patch for version 22.1.34 specifically to resolve the following issue(s) reported in this/the forum(s). 183376


If you have received other patches for the same version for other products, please apply all patches in the order received. 

This fix will be included in our upcoming weekly release which will be available in August 2023. 

  

Please find the feedback link below,

https://www.syncfusion.com/feedback/45230/selection-is-not-disabled-when-we-delete-ink-annotation-using-touch-interaction



RH Rhyme replied to Krithika Ganesan July 26, 2023 12:45 AM UTC

Dear Krithika,


Thank you for your prompt response and for providing the patch fix for the reported issue. I appreciate your efforts in resolving this matter.


However, I would like to inform you that I am currently using version 22.1.37. Could you please confirm whether this patch is compatible with the latest version or if I need to downgrade to version 22.1.34?


Thank you for your assistance.



MS Manigandan Shanmugam Syncfusion Team July 26, 2023 11:06 AM UTC

Rhyme, the patch creation is not supported in any weekly NuGet version. As you are using weekly NuGet version 22.1.37, We will include this fix in our weekly NuGet package, which will be available on August 1st week.



RH Rhyme replied to Manigandan Shanmugam July 27, 2023 12:23 AM UTC

Thanks for your help, Manigandan. I'll be waiting for next week's release.



MS Manigandan Shanmugam Syncfusion Team August 2, 2023 12:41 PM UTC

We have included the fix for this issue “Selection is not disabled when we delete ink annotation using touch interaction” fix in our latest weekly release (22.2.7).

Please use the below link to download our latest NuGet,

Nuget Link:

https://www.nuget.org/packages/Syncfusion.PdfViewer.WPF/22.2.7

Feedback Link:

https://www.syncfusion.com/feedback/45230/selection-is-not-disabled-when-we-delete-ink-annotation-using-touch-interaction


Marked as answer

RH Rhyme August 3, 2023 12:46 AM UTC

Thank you

I can't wait to update and test it out in my project. It's always reassuring to see such responsive and efficient support from the development team.



SS Swetha Srikumar Syncfusion Team August 3, 2023 09:56 AM UTC

Thanks for the feedback.

Please let us know if you need any assistance. 


Loader.
Up arrow icon