Replace image hangs

Hi, I have a PDF in which I want to replace all images with their grayscale version.
At page 54, image 5 (0-based: page53, image 4) it hangs forever at the page.ReplaceImage call.
Also there are a lot of images that are not extracted as images. Please advise how they can be accessed.
Snycfusion.Pdf.Winforms 18.2.0.54. Memory usage is 77 MB.
My code is: 
PdfLoadedDocument origDoc = new PdfLoadedDocument(origFile) {EnableMemoryOptimization = true};
int pagesCount = origDoc.Pages.Count;
for (int pageIndex = 0; pageIndex < pagesCount; pageIndex++)
{
       PdfPageBase page = origDoc.Pages[pageIndex];
       //if (!page.IsColored ) continue;

       Image[] images = page.ExtractImages();
       for( int i = 0; i < images.Length; i++ )
       {
            Image image = ToolStripRenderer.CreateDisabledImage(images[i]);
            PdfBitmap pdfImage = new PdfBitmap( image );
            page.ReplaceImage(i, pdfImage); // it stays here forever
       }
}


Attachment: Tricologia_SITri_seconda_edizione_Tricho_e566b428.zip

6 Replies 1 reply marked as answer

GK Gowthamraj Kumar Syncfusion Team August 24, 2020 09:04 AM UTC

Hi Gyorgy,  

Thank you for using Syncfusion products. 

We were able to reproduce the reported hanging issue in our end. Currently we are validating on this and will update the further details on August 26th , 2020.    

Regards, 
Gowthamraj K 



GG Gyorgy Gorog August 26, 2020 09:55 AM UTC

Gowthamraj, thanks for update.
Just some additional information:
If I export the PDF to Word, and then save it as PDF, ImageReplace does not hang.
This is a possible but not very elegant workaround.
Thanks!


GK Gowthamraj Kumar Syncfusion Team August 26, 2020 01:39 PM UTC

Hi Gyorgy, 
 
We have confirmed that the issue with Hanging issue occurs when replacing the rotated images in a particular PDF” is a defect and patch for this fix will be available on September 9th ,  2020. 
 
Please find the feedback link from below,       
 
Regards, 
Gowthamraj K 



GG Gyorgy Gorog September 9, 2020 12:50 PM UTC

Hi, the feedback link used to work but now it says it is not associated with my account. 
Please advise.
Perhaps it will be part of the next weekly update anyway.
Thanks!


GK Gowthamraj Kumar Syncfusion Team September 9, 2020 01:56 PM UTC

Hi Gyorgy, 

Thank you for your patience. 

We have fixed the reported issue with Hanging issue occurs when replacing the rotated images in a particular PDF” and created a custom NuGet packages with product version 18.2.0.54. Please find the download link below, 
 
Note: We will include this fix in our upcoming Weekly NuGet release and it will be expected to available on September 15th ,2020. 
 
Please find the feedback link from below,       

Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team September 16, 2020 01:47 PM UTC

Hi Gyorgy, 
 
We have included the fix for the reported issue “Hanging issue occurs when replacing the rotated images in a particular PDF" in our weekly NuGet release v18.2.0.58. Please find the download link from below,    
   
Please let us know if you need any further assistance with this.   
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon