Excel到PDF [英] Excel to PDF

查看:62
本文介绍了Excel到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ApplicationClass excelApplication = new ApplicationClass();
            Workbook excelWorkBook = null;

            excelApplication.DisplayAlerts = false;

            string paramSourceBookPath = @"E:\indata\BAC\FileSplitter\Ready\EDOC0E15985105744D5BA91BECCCFB0D111F\Kelly_FaxImage_JobID_updated.xlsx";
            object paramMissing = Type.Missing;

            string paramExportFilePath = @"C:\Test.pdf";
            XlFixedFormatType paramExportFormat = XlFixedFormatType.xlTypePDF;
            XlFixedFormatQuality paramExportQuality =
                XlFixedFormatQuality.xlQualityStandard;
            bool paramOpenAfterPublish = false;
            bool paramIncludeDocProps = true;
            bool paramIgnorePrintAreas = true;
            object paramFromPage = Type.Missing;
            object paramToPage = Type.Missing;

            try
            {
                // Open the source workbook.
                
                excelWorkBook = excelApplication.Workbooks.Open(paramSourceBookPath,
                    paramMissing, paramMissing, paramMissing, paramMissing,
                    paramMissing, paramMissing, paramMissing, paramMissing,
                    paramMissing, paramMissing, paramMissing, paramMissing,
                    paramMissing, paramMissing);

                // Save it in the target format.
                if (excelWorkBook != null)
                    excelWorkBook.ExportAsFixedFormat(paramExportFormat,
                        paramExportFilePath, paramExportQuality,
                        paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage,
                        paramToPage, paramOpenAfterPublish,
                        paramMissing);
            }
            catch (Exception ex)
            {
                // Respond to the error.
            }
            finally
            {
                // Close the workbook object.
                if (excelWorkBook != null)
                {
                    excelWorkBook.Close(false, paramMissing, paramMissing);
                    excelWorkBook = null;
                }

                // Quit Excel and release the ApplicationClass object.
                if (excelApplication != null)
                {
                    excelApplication.Quit();
                    excelApplication = null;
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
                GC.WaitForPendingFinalizers();




我开发了使用c#从excel导出到pdf的程序。一切都很好,但转换时显示progrssbar。我不知道如何禁用yhis。


S. Mukesh Kumar


i have developed program using c# for exporting from excel to pdf. everything is fine but while conversion it shows progrssbar. i dont wnat this how to disable yhis.


S. Mukesh Kumar

推荐答案

为什么进度条的外观有问题?

Why is the appearance of the progress bar a problem?

我可以理解想要在非常短的操作中压制它(1到7秒) - 尽管如此,你应该确保将光标改为等号(沙漏)。 可用性最佳实践是,超过7秒左右,使用进度条告知用户进度是必不可少的
: - )

I can understand wanting to suppress it for very short operations (1 to 7 seconds) -- although then, you should be sure to change your cursor to the wait symbol (hourglass).  Usability best practices are that, beyond 7 seconds or so, it's essential to use a progress bar to inform users of, um, progress :-)

问候,

Anonymous9748

Anonymous9748


这篇关于Excel到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆