We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cropping generating green blank image for some pages of pdf

Hi there,

We are using AsposePDF.dll 21.9 (c# .net 4.7.2) to crop the pdfs to html. Cropping generates a green blank output (instead of the page content) for some pdfs. You can test the issue 53. page of sample pdf by changing cropbox rectangle values.

We couldn’t find any reason. Many thanks for any support.
Sample pdf url : https://we.tl/t-8h5Ehjn8Ed

         var original_book = new Aspose.Pdf.Document(@"C:\99007_1.pdf");

        original_book.Pages[53].CropBox = new Aspose.Pdf.Rectangle(29, 294, 283, 437);
        Document cropped_area = new Document();
        cropped_area.Pages.Add(original_book.Pages[53]);
        string output_file_route = Path.Combine(@"C:\Deneme", "Output.html");
        HtmlSaveOptions opt = new HtmlSaveOptions
        {
            CompressSvgGraphicsIfAny = false,
            AntialiasingProcessing = HtmlSaveOptions.AntialiasingProcessingType.TryCorrectResultHtml,
            UseZOrder = true
        };
        cropped_area.Save(output_file_route, opt);

@eminsanlier

We were able to reproduce the issue in our environment and have logged it as PDFNET-50631 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.