将 Excel 导入 Word,然后导出为 PDF
我目前遇到了问题。我正在用 C# 创建一个报告系统。它使用 Excel 和 Word。系统生成Word文档,然后将Excel文档导入到Word文档中。
问题如下: 如果我有一个带有红色文本的 Word 文档,导出为 PDF,我会得到整齐的红色。与标准 Excel 导出相同。
但是!我想这样做:
- 制作一个 Excel 文档,其中包含(例如)红色文本
- 在 Word 中导入 Excel 文档< br>
- 将 Word 文档导出为 PDF
因此,价值百万美元的问题是:
当我将 Word 导出为 PDF 时,如何保留 excel 中的彩色文本! :-D
我真的很感谢任何帮助!如果这个问题持续一段时间,我可能会给予赏金。
注意:当我将Excel导入Word时,颜色仍然很好。
编辑:我使用 Office 2010 生成报告
Edit2:
I am currently with a problem. I am creating a reporting system in C#. It uses Excel and Word. The system generates a Word document and then imports the Excel document into the Word document.
The problem is as follows:
If I have a Word document with red text export to PDF I get the neat red. Same with a standard Excel export.
But! I want do do this:
- Make a Excel document with (for example) red text
- Import the Excel document in Word
- Export the Word document to a PDF
So the million dollar question is:
How can i keep the coloured text from excel when i export my Word to PDF ! :-D
I really appriciate any help! And i might throw in a bounty if the question stays open for a while.
Note: The color is still good when i import the Excel into Word.
Edit: I use the Office 2010 for generating the report
Edit2:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以下载 Aspose 的试用版。词。
这将处理 Word 文档的创建并输出到 PDF,根据我的经验,它是一个非常好的工具。
You can download a trial version of Aspose.Words.
That will handle the creation of Word documents and output to PDF, and in my experience it's a really good tool.
你能告诉我们你想用Excel做什么吗?它必须先用Excel创建,然后移入Word,然后移入PDF?听起来这确实是您可能想首先看看的东西。
检查 DocX 直接创建 Word 文档(创建表格、制作漂亮的布局等)。然后只需将其转换为 PDF 即可。这很容易而且做得很好。它也是服务器安全的。
除非有非常具体的需要首先创建 Excel,否则我会避免它。
Can you tell us what you're trying to do with Excel that it has to be created with Excel first then moved into Word and then moved into PDF ? Sounds like it's really something you may want to look at first.
Check DocX for creating Word document directly (creating tables, making nice layouts etc). And then just convert it to PDF. It's easy and nicely done. It's also server-safe.
Unless there's very specific need to create Excel first I would avoid it.
程序员 XP,
我不确定为什么“MS Word”部分出现在您的工作流程中。
您从 Excel 开始并想要 PDF,为什么不使用 PDF 创建器。
我在宏中使用了各种免费的 PDF 创建器,通过“打印”到 PDF 服务将电子表格的(部分)转换为 PDF。
查看:http://sourceforge.net/projects/pdfcreator/
这样您就可以跳过“ MS Word”部分,除非您要将 Excel 电子表格添加/组合到现有文档中。
此致,
罗伯特·伊尔布林克
Programmer XP,
I am not sure why the "MS Word" section is in your workflow.
You start with Excel and want a PDF, why not use a PDF creator.
I have used various free PDF creators in macro's to convert (sections) of a spreadsheet into PDF's by "printing" to the PDF service.
Check out: http://sourceforge.net/projects/pdfcreator/
This way you can skip the "MS Word" part, unless you are adding/combining the excel spreadsheet to an existing document.
Regards,
Robert Ilbrink