Free Support Forum - aspose.com

Re: Convert text file to pdf

I am collecting various type of files: Doc, XLS, TXT and PDF. Then users can select which files they would like to join together and they are converted to PDF if needed and then joined. The code is a simple loop with a case statement to determine which converter is needed. The PDF (existing or newly converted) is stuffed into a stream and collected in an array much like your example.

The DOC and XLS conversion worked without an issue. The TXT had the problems mentioned above, but seems to be working now (?). The joining has never worked in the application. and gets the "Exception occurred during the processing stream: 1" error. I have taken the code and moved it to a small stub program and hardcoded the path to all the files and it works properly. The exact same code pasted into my application gives this error. The inner exception is "The directory name is invalid." but a 0 byte file is created. The Message is "Exception occurred in method: GetTempFileName()". Both the stump app and the main app are running on the same machine and, as I said, I am hard coding the path to the source and destination files and doing a straight copy of the code.

Hi Tom,

Thanks for your inquiry.

Could you please post the code you are using here? We will take a look at it and provide you with some further feedback.

Thanks,