Free Support Forum - aspose.com

Non-aspx page capability

I would like to write a component that will take a document (.doc, .rtf, whatever), as input, convert it to a .pdf file, then store the file on the hard drive. That is, I DON'T want to do it on an .aspx page, I want a page to upload the file, THEN pass it to my component and do the processing. I see the example of how to do it on an .aspx page using WebUtil class, but is there a .NET component that does the same thing? Example?
This message was posted using Aspose.Live 2 Forum

Hi,

Thank you for considering Aspose.

You can use Aspose.Words + Aspose.Pdf to convert your document. You can refer to our WinForm demos which have not used any WebUtil class.

Thanks, that sounds like exactly what I need.

Can you tell me where these demos are located? I have been looking around the web site for awhile but can't see where they are, or tell if they are WinForm demos.

Thanks again!

Hi,

Please download the free evalution version of Aspose.Pdf from http://www.aspose.com/community/files/51/file-format-components/aspose.pdf/category1184.aspx. The demos are included with that. After installation you can find them in the Aspose.Pdf installation folder.

Thanks.

So far so good with the product. I really like it so far, but have run into one problem. When I try to create a Document with a .doc file with spaces in the name (i.e. Working With Interfaces.doc), it throws and exception. I'm looking through the documentation, but so far have not seen anything that will help. Am I going to have to strip the spaces out? That seems weird.

Thanks...

Rich

Hi,

Can you give us more detail about the exception that you are getting and the code that you are using.

Thanks.

Here is the code with a comment where the error occurs:

private void button1_Click(object sender, EventArgs e)

{

openFileDialog1.Filter = "Word Files|*.doc";

if (openFileDialog1.ShowDialog() == DialogResult.OK)

{

string fileName = openFileDialog1.FileName;

Document doc = new Document(fileName); //This line of code works fine with file names with no spaces

// but gives Aspose.Words.UnsupportedFileFormatException was unhandled

// exception when a file is used with a space in it

//STRIPS CHRS FROM THE END OF THE STRING

int fileLength = fileName.Length;

string tempString = fileName.Remove(fileLength - 3, 3);

string fileNme = tempString + "pdf";

SaveAsPdf(doc, fileNme);

}

}

I have used file name with space many times before but no error was found. Please make sure you are using the latest version. If it still won’t work please provide the Word document and let us check it.

Ok, I've made significant progress today. The problem must have been with the file as I was able to use several other files with spaces in it.

New problem. I would like to take a .xls file to a .tiff image. I have successfully gotten it to .pdf, and I see several examples of getting CHARTS to images, but so far haven't found how to get a .xls file to image.

I am thinking there is something in the PDF.KIT? Can you point me in the right direction? We are going to want to take .doc files, .rtf files etc to images as well. This is the last hurdle for this project!

Rich

NEVER MIND!

Found it, and have it working.

Very cool.

Rich