How to make the annotations printables ?

Hi,

I have 3 questions in this post thread.

1) It is possible to print the annotations (Stamp, ink ...) ? 

Because they are invisible when printing the PDF file .

There is only the flattened signature, visible when printing the document.

I tried to loop and change the annotation flags to AnnotationFlags.Print when saving the pdf in Sfpdf viewer but the annotations are still invisble.

Does it exist any workaround with the PdfLoadedDocument class, for example ?

2) I' am still facing the "issue" : Application crashes when unloading the PDF. I thought it will be fixed in the last updates : "Service pack release" and "Main release". I tried to change the sfpdf version to : 18.1.0.42 or 18.1.0.52 but the unloading method make my app crash. 

3) Do you have any plans release for providing compression support in the PDF Librarie on  Xamarins Forms ?

16 Replies 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team June 4, 2020 02:38 PM UTC

Hi Rayhane,  
  
Please find the details from below,  
 
1) It is possible to print the annotations (Stamp, ink ...) ?  Because they are invisible when printing the PDF file .  
 
There is only the flattened signature, visible when printing the document.  
 
I tried to loop and change the annotation flags to AnnotationFlags.Print when saving the pdf in Sfpdf viewer but the annotations are still invisble.  
 
Does it exist any workaround with the PdfLoadedDocument class, for example ?  
  
2) I' am still facing the "issue" : Application crashes when unloading the PDF. I thought it will be fixed in the last updates : "Service pack release" and "Main release". I tried to change the sfpdf version to : 18.1.0.42 or 18.1.0.52 but the unloading method make my app crash.   
We were unable to reproduce the issue, “Annotation are not visible while printing the PDF document” and “Application crashes while unloading” in our end.   
  
Please find the sample in the below link,  
  
  
Kindly share the following details to analyze more on this issue and assist you with the better solution    
  
  1. Simple sample/ modify the above sample to reproduce the issue. 
  2. SfPdfViewer version 
  3. Xamarin.Forms version 
  4. PDF document.
  5. Platform.
  6. Replication procedure to reproduce the issue. 
  
Note: We have also checked by printing the PDF document using Adobe Reader after saving in the PDFviewer control.  
  
  
Do you have any plans release for providing compression support in the PDF Library on  Xamarin Forms ? 
We have already logged a feature request for the feature “Support for compressing PDF document in Xamarin Forms platform”. At present we do not have any immediate plans to implement this and will let you know once the feature is implemented. The status the feature can be tracked through our Feature Management System,   
 
  
Regards,  
Sowmiya Loganathan 



RA Rayhane June 8, 2020 09:00 PM UTC

Hi, 

Thank you for the answer. 

I added a simple where I load pdf from list view located in the device storage. 

1) When I try to open the pdf file in PageViewMode="PageByPage" it work fine but When unloading the document, application is crashing. For example, try to load the pdf  with the list view, then after that the document is loaded in the PDFVIEWER page, try to leave the page, it should crash. 

2) In the sample you could see that the stamp isn't visible when printing the document with a custom print adapter.

Sample : https://drive.google.com/file/d/1JFszQjvu8135g33qOccNsEvkp1hsZcJX/view?usp=sharing


AV Ashokkumar Viswanathan Syncfusion Team June 9, 2020 11:40 AM UTC

Hi Rahyane, 
 
Please find the below details, 
  1. When I try to open the pdf file in PageViewMode="PageByPage" it work fine but When unloading the document, application is crashing. For example, try to load the pdf  with the list view, then after that the document is loaded in the PDFVIEWER page, try to leave the page, it should crash. 
We were unable to reproduce the issue, “Application crashes while unloading the PDFviewer control in PageByPage view mode” in Android Platform, its working as expected. 
 
Please find the video illustrate how we checked your sample, 
 
Kindly share the following details to analyze more on this issue and assist you with the better solution   
  1. PDF document which you have used to load in PdfViewer control.
  2. Platform.
  3. Device specification.
  4. Replication video to reproduce the issue
  5. Stack trace.
 
  1. In the sample you could see that the stamp isn't visible when printing the document with a custom print adapter.
We were able to reproduce the issue, “Stamp Annotation are not preserved properly while printing PDF document in PagebyPage View mode” in Android Platform. Currently, we are validating the issue and we will update the further details on June 11th, 2020. 
 
 
Regards, 
Ashok Kumar Viswanathan. 



RA Rayhane June 9, 2020 10:02 PM UTC

Hi, 

I added 2 videos, one were the application is crashing, if I open the pdf then leave just after without interacting with the pdf viewer, toolbar.... and the other were the application doesn't crash when I interact with the pdf viewer or toolbar, for example performing a text search. 

Moreover If I reproduce step 2 (leaving the pdf after interacting with the PDF) then I try to reproduce step 1 (leaving the pdf without interaction) the application will not crash. 

Indeed, I saw in your video that you are interacting with the PDF. It maybe explain why it doesn't crash from your side. 

Tested on real device : Redmi Note 7 and emulator. 



Attachment: Desktop_69f18791.rar


AV Ashokkumar Viswanathan Syncfusion Team June 10, 2020 09:47 AM UTC

Hi Rayhane, 
 
We have tried to reproduce the issue, “Application crashes while unloading the PDFviewer control in PageByPage view mode” by leaving the pdf without interacting with the PDF and toolbar items, but its working as expected in our end.   
 
Please find the video illustrate how we checked your sample,   
 
Kindly share the following details to analyze more on this issue and assist you with the better solution     
  1. PDF document.
  2. Stack trace.
 
Could you please confirm whether you are facing the issue only with a particular PDF document and with a particular device?. If so, kindly share the PDF document along with complete device specifications to reproduce the issue.  
 
As mentioned earlier, currently we are validating the issue, “Stamp Annotation is not preserved properly while printing PDF document in PagebyPage View mode” and we will update further details on June 11th, 2020.  
 
 
Regards, 
Ashok Kumar Viswanathan. 



RA Rayhane June 10, 2020 07:42 PM UTC

Hi, 

I tried with a new PDF document and the issue is not raised with it but I shared 2 PDF document where the application is crashing. 


"Could you please confirm whether you are facing the issue only with a particular PDF document and with a particular device?. If so, kindly share the PDF document along with complete device specifications to reproduce the issue."  

I confirm that I'am facing the issue only with a particular PDF document but I cannot confirm that it is defected with a particular device. I tested on emulators and the issue is raised with the particular PDF documents, howewer for the moment I 'am not able to test with multiples physical device. 


"Please find the video illustrate how we checked your sample,   

https://www.syncfusion.com/downloads/support/directtrac/general/ze/Video827173595.zip"

Could you tried the same steps but with the PDF documents shared ?  

Since I cannot get stacktrace for the moment I shared the output. 


"As mentioned earlier, currently we are validating the issue, “Stamp Annotation is not preserved properly while printing PDF document in PagebyPage View mode” and we will update further details on June 11th, 2020.

With the sample previously shared It aslo happen in "continous page view mode" and not only with the stamp annotation but with all the annotations in general exepted the flatened signature. If, it is not defected from your side could you please shared a sample with a custom print document adapter ? 

Attachment: Desktop_d7fca922.rar



AV Ashokkumar Viswanathan Syncfusion Team June 11, 2020 01:04 PM UTC

Hi Rayhane, 
 
Thank you for the information, 
 
We were able to reproduce the issue, “Application crashes while unloading the PDFviewer control in PageByPage view mode” with the provided PDF document only in the product version v18.1.0.42. However, this issue is resolved in our latest version of SfPdfviewer control with product version 18.1.0.56. Kindly update the SfPdfviewer control to the mentioned version to resolve the issue. 
 
Regarding the issue, “Stamp Annotation is not preserved properly while printing PDF document in PagebyPage View mode”, we do have the support to print the PDF pages in our control. Kindly use the below API to resolve the issue, instead of using the custom Renderer to print pages. 
 
Please find the below code snippet, 
private void PrintButton_Clicked(object sender, EventArgs e) 
{            
   var fileName = Path.GetFileName(this.filePath); 
    pdfViewerControl.Print(fileName);          
} 
 
Please find the modified sample in the below link, 
 
Please try the above solution and let us know whether provided solution resolved your issues 
 
Regards, 
Ashok Kumar Viswanathan. 



RA Rayhane June 15, 2020 12:22 AM UTC

Hi, 

Thank you.

 
We were able to reproduce the issue, “Application crashes while unloading the PDFviewer control in PageByPage view mode” with the provided PDF document only in the product version v18.1.0.42. However, this issue is resolved in our latest version of SfPdfviewer control with product version 18.1.0.56. Kindly update the SfPdfviewer control to the mentioned version to resolve the issue. 

I updated the SfPdfviewer to your latest version and the issue is gone. 


Regarding the issue, “Stamp Annotation is not preserved properly while printing PDF document in PagebyPage View mode”, we do have the support to print the PDF pages in our control. Kindly use the below API to resolve the issue, instead of using the custom Renderer to print pages. 

It tried to use this API, howewer the application is crashing. 

Step to reproduce the issue : 

I shared two document. 

Open the document 1, press print button -> when the previewer is open leave the pdf viewer and go back to the "HomePage".
Then Open the document 2, press print button -> application is crashing : "Object reference not set to an instance of an object."

Moreover I realized that the stamp annotation are not preserved when saving the pdf document. For example if I use an image with transparent background as stamp annotation, the stamp background remaine transparent until I try to save or print the document, at this time the background will be set to white. 

I shared a sample showing that the stamp annotation is not preserved when trying to print the document, in this case. 

https://drive.google.com/file/d/1bNQWLKSufx0nir7SUsLSM7xVg6OoIgvS/view?usp=sharing

Attachment: Desktop_c2a7d4d4.rar


SP Satheesh Palanisamy Syncfusion Team June 15, 2020 11:54 AM UTC

Hi Rayhane,

 
It tried to use this API, howewer the application is crashing.  
 
Step to reproduce the issue:  
 
I shared two documents.  
 
Open the document 1, press print button -> when the previewer is open leave the pdf viewer and go back to the "HomePage". 
Then Open the document 2, press print button -> application is crashing: "Object reference not set to an instance of an object." 
we were able to reproduce the issue, “System.Null reference exception while using SfPdfViewer.Print(string filename)” in Android platform. Currently, we are validating the issue and we will update the further details on June 17th, 2020.  
 
Moreover, I realized that the stamp annotation is not preserved when saving the pdf document. For example, if I use an image with transparent background as stamp annotation, the stamp background remain transparent until I try to save or print the document, at this time the background will be set to white.  
 
I shared a sample showing that the stamp annotation is not preserved when trying to print the document, in this case. 
we were able to reproduce the issue, “Transparency is not preserved while saving the stamp annotation” in Android platform. Currently, we are validating the issue and we will update the further details on June 17th, 2020.  
 


Regards,
Satheesh Palanisamy.



AV Ashokkumar Viswanathan Syncfusion Team June 17, 2020 04:28 PM UTC

Hi Rayhane, 
 
We have confirmed that the issue “Transparency is not preserved while saving the stamp annotation in Xamarin.Forms Android platform ” is a defect and logged a defect report for this issue. The patch for this issue will be delivered on July 8th , 2020. 
 
Please find the feedback in the below link, 
  
 
Sorry for the inconvenience caused, we are still validating the issue, ”System.Null reference exception while using SfPdfViewer.Print(string filename) in Android platform” due to its complexity and we will update further details on June 19th 2020 without any further delay. 
 
Regards, 
Ashok Kumar Viswanathan. 



RA Rayhane June 19, 2020 09:19 AM UTC

Thank you !


AV Ashokkumar Viswanathan Syncfusion Team June 19, 2020 04:21 PM UTC

Hi Rayhane, 
 
We have confirmed that the issue “Application crashes with null reference exception while performing the print operation in Xamarin.Forms Android platform” is a defect and logged a defect report for this issue. The patch for this issue will be delivered on July 10th , 2020. 
 
Please find the feedback link, 
  
 
As mentioned earlier, patch for this issue, “Transparency is not preserved while saving the stamp annotation in Xamarin.Forms Android platform” will be delivered on July 8th , 2020. 
 
Regards, 
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team July 8, 2020 03:15 PM UTC

Hi Rayhane,      
     
We have resolved the issue, “Transparency is not preserved while saving the stamp annotation in Xamarin.Forms Android platform” and the consolidated custom NuGet for the same can be downloaded from the following link         
      
Custom NuGet :   
 
Please find the feedback link, 
https://www.syncfusion.com/feedback/15336/android-transparency-is-not-preserved-while-saving-the-stamp-annotation 
 
Disclaimer:   
Please note that we have created this NuGet for version 18.1.0.59 specifically to resolve the following issue(s) reported in this/the Forum. 154877
 
    
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.    
     
        
The fix for the  issue will be included in our 2020 Volume 2 Service pack release which will be available in the month of July 2020.  
 
As mentioned earlier, patch for this issue, “Application crashes with null reference exception while performing the print operation in Xamarin.Forms Android platform” will be delivered on July 10th , 2020. 
     
Regards,     
Ashok Kumar Viswanathan.  



AV Ashokkumar Viswanathan Syncfusion Team July 10, 2020 05:25 PM UTC

Hi Rayhane,      
     
We have resolved the issue, Application crashes with null reference exception while performing the print operation in Xamarin.Forms Android platform and consolidated custom NuGet for the same can be downloaded from the following link         
      
Custom NuGet :   
 
Please find the feedback link, 
     
Disclaimer:   
Please note that we have created this NuGet for version 18.1.0.56 specifically to resolve the following issue(s) reported in this/the forum. 154877
 
    
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.    
     
        
This fix will be included in our 2020 Volume 2 service pack release which will be expected to be available in the month of July 2020.   
     
Regards,     
Ashok Kumar Viswanathan.  


Marked as answer

RA Rayhane July 14, 2020 01:42 PM UTC

Hi

Thank you for the updates 


PN Preethi Nesakkan Gnanadurai Syncfusion Team July 15, 2020 12:09 PM UTC

Hi Rayhane, 
  
Most welcome. 
  
Regards, 
Preethi 


Loader.
Up arrow icon