All data in page is not converted to image using ExportAsImage method of PdfLoadedDocument class

I am using ExportAsImage to convert first page of pdf file to image. But all data in first page is not converted to image. Look like issue of multiple layer in pdf page. 

If I use Smallpdf.com tool to first convert pdf to image and then again convert to pdf and then use ExportAsImage method the it work fine.  

using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(path))
            {
                          Image extractedImage;
             
                        extractedImage = loadedDocument.ExportAsImage(0);
          }

sample pdf is also attached 

I am using version 15.3460.0.26

Attachment: samplepdf_11f69dcb.zip

9 Replies

AA Akshaya Arivoli Syncfusion Team April 20, 2020 12:42 PM UTC

Hi Devinder, 

Thank you for contacting Synfusion support. 

We can resolve this issue by exporting the PDF document pages to images using EJ2 PDF Viewer server library.  Add the following dependency to your application using the NuGet Package Manager to working with ExportAsImage() functionality with their respective environments 

  • Windows - Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows
  • Linux - Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux 
  • IOS-  Syncfusion.EJ2.PdfViewer.AspNet.Core.OSX 

Please refer the below UG link for more details. 

 

Please try this and revert us if you have any concerns on this. 

Regards, 
Akshaya 



DE devinder May 1, 2020 05:38 PM UTC

Hi

Thanks for your support. I have tried your solution. It solved our problem upto some extend. But issue is still there if pdf is signed.

I am attaching the sample pdf with signature. Signature are not coming in converted pdf.

if I convert same pdf with smallpdf.com (an online utility) then signature are coming in converted image.

Kindly check the attached sample pdf for your reference



Attachment: sample01_eb2b7cd0.zip


AA Akshaya Arivoli Syncfusion Team May 4, 2020 07:56 AM UTC

Hi Devinder, 

Thank you for your update. 

We can reproduce the reported behavior with the provided document. We will analyze further on it and update you with more details on May 6th, 2020 

Regards, 
Akshaya 



AA Akshaya Arivoli Syncfusion Team May 6, 2020 12:40 PM UTC

Hi Devinder, 

We have confirmed that the reported issue is a defect and logged the defect report for the same. The fix for the issue will be included in our upcoming weekly NuGet release on May 20th, 2020. You can track the status of the bug using the below feedback link, 


Regards, 
Akshaya


AA Akshaya Arivoli Syncfusion Team May 20, 2020 11:12 AM UTC

Hi Devinder, 

Sorry for the inconvenience caused. 

The fix for the reported issue was not included in our latest weekly release, however it will be included in our upcoming weekly NuGet release on May 27th, 2020. 

Regards, 
Akshaya 



AA Akshaya Arivoli Syncfusion Team May 27, 2020 03:03 PM UTC

Hi Devinder, 


The fix for the reported issue was not included in our latest weekly release. However, it will be included in our upcoming weekly release on June 3, 2020. Please find the custom packages from the below link, 



Note:If the isSkipAnnotations is provided as false then we will export the signature in the page . 
public Bitmap ExportAsImage(int pageIndex, bool isSkipAnnotations) 
        {} 
        /// <summary> 
        /// Exports the specified page as Image 
        /// </summary> 
        /// <param name="pageIndex">The page index to be converted into image</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified page as Image</returns> 
public Bitmap ExportAsImage(int pageIndex, float dpiX, float dpiY, bool isSkipAnnotations) 
        {} 
 
/// <summary> 
        /// Exports the specified page as Image with respect to dpi specified. 
        /// </summary> 
        /// <param name="pageIndex">The page index to be converted into image</param> 
        /// <param name="dpiX">The horizontal DPI of the resultant image.</param> 
        /// <param name="dpiY">The vertical DPI of the resultant image.</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified page as Image  with custom resolution</returns> 
public Bitmap[] ExportAsImage(int startIndex,int endIndex, float dpiX, float dpiY, bool isSkipAnnotations) 
        {} 
/// <summary> 
        /// Exports the specified pages as Images with respect to dpi specified. 
        /// </summary> 
        /// <param name="startIndex">The starting page index</param> 
        /// <param name="endIndex">The ending page index</param> 
        /// <param name="dpiX">The horizontal DPI of the resultant image.</param> 
        /// <param name="dpiY">The vertical DPI of the resultant image.</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified pages as Images with custom resolution</returns> 
public Bitmap[] ExportAsImage(int startIndex, int endIndex, bool isSkipAnnotations) 
      {} 
        /// <summary> 
        /// Exports the specified pages as Images 
        /// </summary> 
        /// <param name="startIndex">The starting page index</param> 
        /// <param name="endIndex">The ending page index</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified pages as  
Images</returns> 
public Bitmap[] ExportAsImage(int startIndex, int endIndex,SizeF customSize,bool keepAspectRatio, bool isSkipAnnotations) 
        { } 
/// <summary> 
        /// Exports the specified pages as Images 
        /// </summary> 
        /// <param name="startIndex">The starting page index</param> 
        /// <param name="endIndex">The ending page index</param> 
        /// <param name="customSize">The custom size of the converted image</param> 
        /// <param name="keepAspectRatio">Whether need to maintain the pdf page size</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified pages as images with custom size</returns> 
  public Bitmap[] ExportAsImage(int startIndex, int endIndex, SizeF customSize, float dpiX,float dpiY,bool keepAspectRatio, bool isSkipAnnotations) 
        { } 
 
/// <summary> 
        /// Exports the specified pages as Images 
        /// </summary> 
        /// <param name="startIndex">The starting page index</param> 
        /// <param name="endIndex">The ending page index</param> 
        /// <param name="customSize">The custom size of the converted image</param> 
        /// <param name="dpiX">The horizontal DPI of the resultant image.</param> 
        /// <param name="dpiY">The vertical DPI of the resultant image.</param> 
        /// <param name="keepAspectRatio">Whether need to maintain the pdf page size</param> 
       /// <param name="isSkipAnnotations"> Whether need to keep the annotation of the page </param> 
 
        /// <returns>Returns the specified pages as images with custom size and resolution</returns> 
 
 


Regards,   
Akshaya   




AA Akshaya Arivoli Syncfusion Team June 3, 2020 11:07 AM UTC

 
We have fixed the reported issue and the fix for the issue was included in our latest weekly NuGet release v18.1.0.55. Kindly upgrade to the latest version to get the issue resolved. 
 
Packages link:    
     
Client side package    
   
Blazor Client  
Service side package    
ASP.NET Core :    
     
ASP.NET MVC:    
   
CDN links:   
   
   
Regards,   
Akshaya  


DE devinder June 4, 2020 02:45 AM UTC

We are still facing the same problem after updating the new dlls provided in latest release.

Issue still not resolved


AA Akshaya Arivoli Syncfusion Team June 5, 2020 11:42 AM UTC

Hi Devinder, 

Thank you for your update. 

We are unable to reproduce the reported issue with the provide details in v18.1.0.55. We have created sample for the same and shared in the below link, 


Please try it with the latest version and revert us with more details and the modified sample, PDF document, replication procedure if you are still facing the issue. These details will be helpful for us to investigate further and assist you better. 

Regards, 
Akshaya 


Loader.
Up arrow icon