Office2Pdf
Convert Office documents to Pdf
Install / Use
/learn @stivencamara/Office2PdfREADME
Office2Pdf
Convert Office documents to Pdf
Example
Convert docx to pdf
IConverter conveter = new DocumentConverterFactory().GetConverter(ContentType.DOCX);
var sourcePath = Path.Combine(Environment.CurrentDirectory, "docs", "Test.docx");
var targetPath = Path.Combine(Environment.CurrentDirectory, "docs", "Testdocx.pdf");
conveter.Convert(sourcePath, targetPath, false);
Convert xls to pdf
IConverter conveter = new DocumentConverterFactory().GetConverter(ContentType.XLS);
var sourcePath = Path.Combine(Environment.CurrentDirectory, "docs", "Test.xls");
var targetPath = Path.Combine(Environment.CurrentDirectory, "docs", "Testxls.pdf");
conveter.Convert(sourcePath, targetPath, false);
Convert ppt to pdf
IConverter conveter = new DocumentConverterFactory().GetConverter(ContentType.PPT);
var sourcePath = Path.Combine(Environment.CurrentDirectory, "docs", "Test.ppt");
var targetPath = Path.Combine(Environment.CurrentDirectory, "docs", "Testppt.pdf");
conveter.Convert(sourcePath, targetPath, false);
How to setup DCOM Configuration Settings to use Office Interop Word, Excel, and Access with ASP.NET C# on a IIS Windows Server machine
0x800A03EC Cannot access the file
The 0x800A03EC Cannot access the file is arguably the worst error you can experience, as the given error message is completely misleading. To fix that, you have to the following:
Create the following new folders on your Windows Server + IIS machine:
- C:\Windows\SysWOW64\config\systemprofile\Desktop (for 64-bit Servers only)
- C:\Windows\System32\config\systemprofile\Desktop (for both 32-bit and 64-bit Servers)
- Set Full control permissions for these Desktop folders for the Application Pool user (IIS AppPool\DefaultAppPool if you’re using the ApplicationPoolIdentity dynamic account).
https://www.ryadel.com/en/office-interop-dcom-config-windows-server-iis-word-excel-access-asp-net-c-sharp/
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
