Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Oct 16, 2019 10:32 am

Hi

I have downloaded SpireDoc and use the NET2.0 versions of the DLL (which I assume is Standard 2.0).

We are testing if we can convert Word documents to PDF and lucky enough there is a code sample showing that:

Code: Select all
                           
Spire.Doc.Document spireDocument = new Spire.Doc.Document();
spireDocument.LoadFromFile(@"E:\work\documents\TestSample.docx");
spireDocument.SaveToStream(new MemoryStream(), FileFormat.PDF);


I have added namespace and changed variable name to reduce the list of possible errors. Finally I have replaced SaveToFile with SaveToStream.

When I compile it, I get following errors for the SaveToStream:

Error CS0117 'FileFormat' does not contain a definition for 'PDF'

FileFormat seem not to be containing a PDF option (but your example do)

What am I doing wrong?

PS. I use the DLL's from the latest hotfix and only those. Is that a problem? I have enclosed the license file.

dalbysdu
 
Posts: 1
Joined: Wed Oct 16, 2019 9:36 am

Thu Oct 17, 2019 2:41 am

Hi,

Thanks for your inquiry. This is Betsy from E-iceblue support team.
Our Spire.Doc supports .NET, .NET Standard and .NET Core. As for your error, I guess you were using Spire.Doc Standard Edition which only supports .NET and doesn’t support converting Word to PDF.

You need to use Pro version. Please download the latest Spire.Doc Pack(hot fix) Version:7.9.9 from our website, and reference the dlls from the folder netcoreapp2.0 in your .NET Core 2.2 project. Or you could download it via NuGet: https://www.nuget.org/packages/Spire.Doc/

Any question, welcome to get it back to us.

Best wishes,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc

cron