PDF image cell low quality

Posted by: patrik on 9 February 2018, 4:51 pm EST

  • Posted 9 February 2018, 4:51 pm EST


    When I make a PDF image cell get very low quality(DPI)

    FpSpread1.EditMode = False
    Dim SaveD As New SaveFileDialog()
    Dim SaveD1 As String
    SaveD.FileName = FpSpread1.ActiveSheet.GetText(4, 3) & ".PDF"
    If Config_PDF_path <> "" Then SaveD.InitialDirectory = Config_PDF_path
    SaveD.Filter = "PDF (*.PDF)|*.PDF"
    SaveD1 = SaveD.ShowDialog()
    If SaveD1 <> 1 Then Exit Sub

    Dim printset As New FarPoint.Win.Spread.PrintInfo
    Dim printmar As New FarPoint.Win.Spread.PrintMargin
    printmar.Left = 60
    printmar.Top = 20
    printmar.Right = 20
    printmar.Bottom = 20

    printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange
    printset.ShowBorder = False
    printset.RowStart = 0
    printset.ColStart = 0
    printset.RowEnd = 59
    printset.ColEnd = 5
    printset.Footer = ""
    printset.Margin = printmar
    printset.PdfFileName = SaveD.FileName
    printset.PrintToPdf = True
    printset.ShowColor = True
    'printset.Footer = "/g""1""/r/cl""4""This is page /p of /pc"

    ' Print the sheet.
    With FpSpread1
    For i = 0 To .Sheets.Count - 1
    FpSpread1.Sheets(i).PrintInfo = printset
    End With
    Application.DoEvents() : Application.DoEvents()
    OpenDocument(SaveD.FileName, "")
  • Replied 11 February 2018, 5:13 pm EST


    Currently Spread exported the images as jpeg when saved to PDF which makes the resolution low. This has been added as an enhancement request for future version of Spread for Windows Forms. The tracking id for this issue is #254293.

    Deepak Sharma
  • Replied 8 September 2020, 5:13 pm EST

    Any updates on this issue ?

    Best regads
  • Replied 9 September 2020, 6:05 pm EST


    The issue was fixed in Spread.NET 11 SP1 release. You can download the latest Spread.NET 11 version from here: https://cdn.grapecity.com/SpreadNET/installer/11.0.20183.0/offlineDownload_Full.zip
    To see the fix, you can use the following code:
    fpSpread1.ActiveSheet.PrintInfo.PdfQualityMode = System.Drawing.Drawing2D.QualityMode.High;
    fpSpread1.ActiveSheet.PrintInfo.PdfFileName = "Test.pdf";
    fpSpread1.ActiveSheet.PrintInfo.PrintToPdf = true;
  • Replied 9 September 2020, 8:37 pm EST

    Hello Ruchir
    Thank you for the answer.
    I have tried the Spread .Net 13 in trial mode:
    The orginal that is visible in program:

    Then the one in PDF:

    Even the cell lines and fillings looks wrong if i zoom in:
    Image in next post

    The code :

    var sheets = summarySheetPDFExport.SelectedSheets;
    foreach (SheetView sv in sheets)
    if (sv.PrintInfo == null)
    sv.PrintInfo = new PrintInfo();

    sv.PrintInfo.ShowBorder = false;
    sv.PrintInfo.ShowGrid = false;

    sv.PrintInfo.ShowPrintDialog = false;
    sv.PrintInfo.Preview = false;
    sv.PrintInfo.Centering = Centering.Horizontal;
    sv.PrintInfo.PrintToPdf = true;
    sv.PrintInfo.PdfFileName = sfd.FileName;
    sv.PrintInfo.ShowColor = true;
    sv.PrintInfo.PdfQualityMode = System.Drawing.Drawing2D.QualityMode.High;
    sv.PrintInfo.ShowColumnHeader = PrintHeader.Hide;
    sv.PrintInfo.ShowRowHeaders = false;



    It seams like there is somthing wrong here :(

    Best regads
  • Replied 9 September 2020, 8:41 pm EST

    Image refered to in post above where the fill and lines are wrong:
  • Replied 11 September 2020, 3:41 am EST


    I do not see the issue at my end, I would recommend you to set the Style of ImageCelltype to either Stretch or StretchAndScale to get proper results. For reference I have attached the application and the output at my end. Can you run the application and see, if you still see the issue.

  • Replied 13 September 2020, 4:00 am EST

    I have modified the project you sent to use my xml:

    Still like this:

    Best regards
  • Replied 14 September 2020, 7:02 pm EST


    I am able to reproduce the issue. I have escalated the issue to the development team(SPNET-12015) and will inform you once I get any updates from them.

  • Replied 22 September 2020, 1:42 am EST

    Hi Mikael,

    The team has provided information that as in this case the image is a Rectangle shape with the picture, when exporting to pdf spread will use the GIF Format to support the transparent. So this is as limitation of shape feature.

    Is the feature critical and urgent for your application?

  • Replied 22 September 2020, 4:13 am EST

    Hi Rachir
    Im sad to hear that.

    As im evaluating upgrade from Farspread 8.2 -> Spread.Net 13 (Or later) i would say its critical. This and the https://www.grapecity.com/forums/spread-winforms/pdf-cells-are-not-filled-c are major flaws that would stop an upgrade. And in the long term we would have to look for alternatives. We already have customer annoyed over theese problems thats why im looking into this.

    Best regards
  • Replied 22 September 2020, 9:42 pm EST

    Hello Mikael,

    Thank you for confirming.
    I have forwarded this information to the team and the feature would be available in a future release version [ID: 12326]. I will get back to you as soon as there is an ETA available.

  • Replied 22 September 2020, 10:10 pm EST

    Ruchir Thanks for the answers. Looking forward to test the new release :)

    Best regards
  • Replied 28 September 2020, 8:49 pm EST

    Hi Mikael,

    Just to mention, w.r.t. exporting image cell to PDF, the behavior in v13 is the same as as v8 and is not a breaking change but an enhancement request. This request has been submitted to dev, which will be considered in one of the future v14 release.

  • Replied 1 October 2020, 5:19 pm EST

    Hope it will make it then. Maybe this problem i seen more now when screen resolutions are higher then when the v8 was released.

    Best regards
  • Replied 1 October 2020, 10:21 pm EST


    Yes, that could be the cause, as this is the same behavior as v8. We will keep you updated with the progress on this.

  • Marked as Answer

    Replied 15 November 2020, 6:58 pm EST

    Hello Ruchir
    I have tried the V14 and it looks like the quality of my image changed to better:

    Best Regards
Need extra support?

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

Learn More

Forum Channels