Ugly ComboBox text in PDF export

Posted by: titan2x on 8 September 2017, 1:52 pm EST

  • Posted 8 September 2017, 1:52 pm EST

    I print fpspread to PDF like this:

            public Form2()
            {
                InitializeComponent();

                fpSpread1.Dock = DockStyle.Fill;

                ComboBoxCellType combobox = new ComboBoxCellType();
                combobox.Items = new string[] { "", "one", "two", "hello" };

                fpSpread1.ActiveSheet.Cells[1, 1].CellType = combobox;
                fpSpread1.ActiveSheet.Cells[1, 1].Value = "hello";
                fpSpread1.ActiveSheet.Cells[1, 0].Value = "hello";
            }

            private void button1_Click(object sender, EventArgs e)
            {
                SaveFileDialog _savefiledialog = new SaveFileDialog();

                string _displayname = "UglyComboBox";

                _savefiledialog.Filter = "PDF Files | *.pdf";
                _savefiledialog.FileName = _displayname + ".pdf";

                if (_savefiledialog.ShowDialog() == DialogResult.OK)
                {
                    PrintInfo pi = new PrintInfo();
                    pi.Preview = true;
                    pi.Margin.Top = 30;
                    pi.Centering = Centering.Horizontal;
                    pi.JobName = _displayname;
                    pi.ZoomFactor = .75f;

                    pi.Preview = false;
                    pi.PrintToPdf = true;
                    pi.PdfFileName = _savefiledialog.FileName;
                    pi.PdfWriteTo = PdfWriteTo.File;

                    fpSpread1.ActiveSheet.PrintInfo = pi;
                    fpSpread1.PrintSheet(fpSpread1.ActiveSheet);
                }


            }

    Is there a way to print to PDF without the ComboBox text becoming butt ugly?

    Thanks,
    Janos


  • Replied 8 September 2017, 1:52 pm EST

     


    Hello Janos,


    You will get  a clear image of ComboBox,when you have  ZoomFactor = 1F.


    It takes ZoomFactor = 1F bydefault you dont need to assign it.


    Thanks,


    Deepak Sharma

  • Replied 8 September 2017, 1:52 pm EST

    Janos,


    I am reporting this as a bug (#25667) for the development team to fix for the next maintenance release.

  • Replied 8 September 2017, 1:52 pm EST

    Janos,


    This bug came back As Intended. The reason being is because the combobox is being exported to PDF as an image which will not scale as well as the text.

  • Replied 8 September 2017, 1:52 pm EST

    Thanks for getting back to me.

    If the combobox doesn't contain graphical data it doesn't make much sense to convert it to image. At least I should have the option to control the behavior and drop graphics. Can you add a feature request?

    Thanks,
    Janos

  • Replied 8 September 2017, 1:52 pm EST

    Janos,


    The combobox button itself is graphical and thus the reason for exporting the way we do. I will write this up as an enhancement request for you.

  • Replied 8 September 2017, 1:52 pm EST

    Scott,

    When you export it to Excel it becomes non-graphical, and in fact it's pretty smart. Can't you do the same for PDF export? If you think from a user's perspective, a combobox is traditionally not so much about graphics as it is about selecting (textual) items from a defined set of valid values. The Excel export function seems to use the underlying textual representation of cells, I'm asking for an option to do the same for PDF.

    In any case, this is not a critical issue and you can treat it as low priority. 

    Thanks,
    Janos

  • Replied 8 September 2017, 1:52 pm EST

    Thanks Deepak, that's a significant improvement!

    However, the ComboBox is still not as clear as regular text cells. Is there a way to further improve this?

    Thanks,
    Janos

     

Need extra support?

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

Learn More

Forum Channels