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 Mar 09, 2016 3:38 pm

Hi,
I am using trial version to check whether spire.doc will fit my requirement or not.
I will have to convert doc or docx to pdf and save it to a location without opening it directly after conversion. I checked with trail version using the below code. Document got converted successfully to pdf but System.Diagnostics.Process.Start is opening the document as soon as it gets converted. My requirment is not to open but i need to save it to file system(to a particular path)

using Spire.Doc;
using Spire.Doc.Documents;


namespace DoctoPDF
{


class toPDF
{


static void Main(string[] args)
{

//Load Document

Document document = new Document();

document.LoadFromFile(@"E:\work\documents\TestSample.docx");

//Convert Word to PDF

document.SaveToFile("toPDF.PDF", FileFormat.PDF);

//Launch Document

System.Diagnostics.Process.Start("toPDF.PDF");
}
}
}


I modified above code in the below format
Document document = new Document();

document.LoadFromFile(@"E:\doctopdftest\doc\cp.docx");

//Convert Word to PDF

document.SaveToFile(@"E:\doctopdftest\pdf\cp.PDF", FileFormat.PDF);

and commented System.Diagnostics.Process.Start but pdf is not getting saved to file system. Let me know if it supports or not so that i can go for paid version if it supports saving instead of opening after conversion.[/color][/color][/color][/color]

dileep.pingeli
 
Posts: 1
Joined: Wed Mar 09, 2016 3:00 pm

Thu Mar 10, 2016 9:53 am

Hello,
Thanks for your feedback.
The function of the code “System.Diagnostics.Process.Start("toPDF.PDF");” is to view the output for ourselves when do the demo, it is not related to our product. You can omit it.
If there is any question, welcome to get it back to us.
Best Regards,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Tue Mar 15, 2016 7:16 am

Hi,

Did you solve the problem? If you have other problems, please let us know. Thanks.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Return to Spire.Doc

cron