Export To PDF distorting images added programatically

Posted by: mithila.kulkarni on 21 November 2017, 3:24 pm EST

    • Post Options:
    • Link

    Posted 21 November 2017, 3:24 pm EST

    We have used FP Spread container for our application and have created excel look alike sheets for our requirements.

    We have used “Microsoft.Office.Interop.Excel.Application” to export to excel and then convert to PDF using “ExportAsFixedFormat” method.

    We are facing issue when we export it to PDF, images which we load programmatically get distorted and hence border of image cells is not displayed and neat look of excel is destroyed.

    Export to excel is working fine. Please check attached images.

    We have tried:

    1. Cell padding before export
    2. Cell padding while exporting to PDF

      Both of these options are not working.

    Please help us to resolve the issue.

    We are using Visual studio 2013 and OS: Windows 7 Enterprise

    Please help.

    Thank you in advance.

  • Posted 23 November 2017, 2:11 am EST

    Hello,

    I am able to replicate this issue where the image quality goes down after exporting the Spread to PDF with image in the cell.

    I have reported the same to the development team as a bug. I will let you know as soon as I get an update on this.

    The tracking id for this issue is 250527.

    Thanks,

    Deepak Sharma

  • Posted 26 November 2017, 9:20 pm EST

    Hello Deepak and Team,

    Thank you for your reply.

    We will be looking forward to hearing from you on this issue.

    Thanks in advance.

    Regards,

    Mithila

  • Posted 4 December 2017, 10:32 pm EST

    Hello Mithila,

    As per the development team for painting image to PDF, we have internal logic to export some formats as JPG. It will reduce the quality of rendering.

    If you want to keep the original quality, you can use BMP or GIF format.

    Thanks,

    Deepak Sharma

  • Posted 30 January 2019, 4:08 pm EST

    Hello Team,

    We have tried different formats but still facing same issue.

    Can you please look into it again and let us know the updates.

    Thanks and Regards,

    Mithila

  • Posted 3 February 2019, 6:13 pm EST

    Hello,

    May I know which particular format you are facing this issue with?

    As suggested by developers you should use the BMP or GIF format for image for better quality.

    Thanks,

    Deepak Sharma

  • Posted 6 February 2019, 5:11 pm EST

    Hi,

    We are using .jpg format but as per your suggestion we tried with .bmp format as well but still the image gets distorted when exported to pdf.

    Thanks,

    Mithila

  • Posted 6 February 2019, 10:38 pm EST

    Hi Mithila,

    I have informed the development team about this issue. I will update you as soon I hear anything from them.

    Thanks,

    Deepak Sharma

  • Posted 7 February 2019, 10:54 pm EST

    Hello,

    Our development team wants to know if you are viewing the exported PDF at 100% zoom?

    Thanks,

    Deepak Sharma

  • Posted 18 February 2019, 10:27 pm EST

    Hello,

    we are using SaveExcel method of FpSpread and exporting to excel and after that we use “ExportAsFixedFormat” method to export to PDF.

    When we open PDF file, its default zoom is 142%

    what can we change in our code to solve the images issue?

  • Posted 19 February 2019, 3:04 pm EST

    More update: even if we change zoom level to 100% still the images are distorted and removes borders of containing cell

  • Posted 20 February 2019, 1:02 am EST

    Hi,

    May I know why you are not exporting to PDF directly from Spread using PrintInfo object?

    Thanks,

    Deepak Sharma

  • Posted 20 February 2019, 5:48 pm EST

    Hi Deepak,

    will exporting to PDF directly solve the issue of images?

    Have you tried it?

    Regards,

    Mithila

  • Posted 21 February 2019, 8:51 pm EST

    Hi Mithila,

    I tested this issue with directly exporting PDF from Spread. I found that the image quality is still not very good. I have asked the development team to look into it again and come up with a solution.

    I will inform you as soon as I get an update on it.

    Thanks,

    Deepak Sharma

  • Posted 21 August 2019, 5:59 pm EST

    Hello,

    Sorry for long delay, this issue has been identified as a design behavior.

    The development team said that they checked the logic export, and found that the image is export with full size. They tested the issue with Excel and identified that the excel has the same problem with this issue when export to pdf file. It seems, this issue happens because the logic painting of pdf file. So I think this is issue of pdf file. Development team could not find a work-around for this issue as of now.

    Sorry for the inconvenience.

    Thanks,

    Deepak Sharma

  • Posted 12 January 2020, 8:52 pm EST

    Hello Team,

    Any update on this?

    We have upgraded to Spread.Net 13 and still the problem persists. This is very critical for us now and needs to be resolved.

    Can you please check and let us know.

    Regards,

    Mithila

  • Posted 13 January 2020, 11:13 pm EST

    Hi,

    As mentioned above, the issue is specific to PDF. Internally, the full size image is exported in PDF but the image still appears distorted. Also, we don’t have a workaround for this.

    Sorry for the inconvenience.

    Regards,

    Jitender

  • Posted 16 January 2020, 2:50 pm EST

    Hi Team,

    To handle the issue related to images, I tried PrintInfo.PrintToPdf property.

    This way at least the image quality is good but it has created other issues related to paging.

    We are using below common code to print all the sheets. Some sheets are dividing columns into different pages. Please find attached MI-T-526-0000.pdf with problems and Sheet DM-T-200.0002 is perfect.

    Check below code:

    printInfo.PrintToPdf = true;

    printInfo.PdfWriteMode = PdfWriteMode.New;

    printInfo.ShowColor = true;

    printInfo.PdfFileName = saveFileDialogExportToPDF.FileName;

    printInfo.ShowBorder = false;

    printInfo.PrintType = FarPoint.Win.Spread.PrintType.CellRange;

    printInfo.ColStart = 0;

    printInfo.ColEnd = 10;

    printInfo.RepeatRowStart = 0;

    printInfo.RepeatRowEnd = 10;

    printInfo.Orientation = FarPoint.Win.Spread.PrintOrientation.Landscape;

    printInfo.ShowColumnHeader = FarPoint.Win.Spread.PrintHeader.Hide;

    printInfo.ShowRowHeader = FarPoint.Win.Spread.PrintHeader.Hide;

    printInfo.ZoomFactor = 0.7F;

    SpreadContainer.Sheets[0].PrintInfo = printInfo;

  • Posted 16 January 2020, 4:12 pm EST

    attachmentsPDFFiles.zip

  • Posted 16 January 2020, 7:11 pm EST

    Hi,

    Can you please attach an excel file with the data where the issue occurs so we can try the export operation at our end?

    Thanks,

    Jitender

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels