We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SaveToPdf does not work

Hi,
Iam using Aspose to convert a stream to pdf, this is the code I am using:

using (System.IO.MemoryStream rtfStream = new System.IO.MemoryStream())
{
System.IO.StreamWriter tw = new System.IO.StreamWriter(rtfStream);
tw.Write(RtfHeader);
tw.Write(RtfBody);
tw.Flush();
Aspose.Words.Document doc = new Aspose.Words.Document(rtfStream);

doc.SaveToPdf(pdfFilename); // THROWS AN EXCEPTION
}

The exception message is:
“could not find a part of the path: C:\Programme\IBM\Lotus\Expeditor\rcp\eclipse\plugins\com.ibm.rcp.j2se.win32.x86_1.6.0.20090820a-200909091600\jre\lib\fonts\LucidaBrightRegular.ttf”

I can not imagine why the SaveToPdf() method needs this path?
Everything worked very well until I have installed 2 Lotus Notes clients (version 7 and version8), that are now running concurrently at my laptop.

Does SaveToPdf() needs some kind of registry-entries or environment variables?

Many thanks in advance

Scheu

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Aspsoe.Words reads registry to find an appropriate font. Registry key is font name and registry value is font file name. The problem might occur font does not exist in the defined location.

But this problem was resolved in Aspose.Words 8.0. So Could please check one more time with the latest version?

Best regards

Hi,
thanks for your answer.
Now I have updated the Aspose dlls to the actual version and the problem is solved with Aspose.Word.
But I still have the same “registry” problem with Aspose.Slides (I have also tried Aspose.Slides1.1), while trying to convert .ppt to pdf. Here is my code:

MemoryStream presentationStream = new MemoryStream();
presentation.Save(presentationStream, Aspose.Slides.Export.SaveFormat.Pdf);
outputStream = null;
FileStream outputStream = File.Create(pdfFilePath);
filestream.WriteTo(outputStream);

I become the same exception as describe above. Will this be fixed in the near future?

Thanks in advance.


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I will move your request into the Aspose.Slides forum. My colleagues from Aspose.Slides team will answer you shortly.

Best regards.

Hi,

Please use the following code snippet with Asopose.Slides for .NET 4.1.0. I have used it to convert a PPT fie to PDF using file stream, For your reference, i have also attached source PPT and exported PDF fiile as well.

[C#]

MemoryStream presentationStream = new MemoryStream();

String pdfFilePath = "D://ppt//Test.pdf";

Presentation presentation = new Presentation("D://ppt//Test.ppt");

presentation.Save(presentationStream, Aspose.Slides.Export.SaveFormat.Pdf);

MemoryStream outputStream = null;

FileStream outputStreams = File.Create(pdfFilePath);

presentationStream.WriteTo(outputStreams);

Thanks and Regards,

This is EXACTLY the same code I am using as you can see above.

It might work finally on your machine as it worked on mine too until I have installed 2 Lotus Notes Clients concurrently and hence had to change some registry keys (but only lotus notes related keys). As I have also explained above.
This problem occured with the old version of Aspose.Words and has been fixed in the latest version but is still open in the latest version of Aspose.Slides.

Here is the answer of Aspose.Word team:

“Aspsoe.Words reads registry to find an appropriate font. Registry
key is font name and registry value is font file name. The problem might occur
font does not exist in the defined location. But this
problem was resolved in Aspose.Words 8.0. So Could please check one more time
with the latest version?”


Regards

Hi,

I have retested the above mentioned code and my findings are same as before. I would suggest, that you please try the same code on some other platform. As mentioned earlier, i have utilized the latest version of Aspose.Slides for .NET 4.1.0.

We are sorry for your inconvenience,

The problem is definitively NOT the CODE but that Aspose.Slides reads Registry to find some Fonts as mentioned above by your colleague “alexey.noskov” from Aspose.Words team. This is a BUG, which has been fixed in Aspose.Words but not in Aspose.Slides.
Could you please contact your Aspose.Words collegues to find out how they fixed this issue?

The exception message once again is:

“could not find a part of the path:
C:\Programme\IBM\Lotus\Expeditor\rcp\eclipse\plugins\com.ibm.rcp.j2se.win32.x86_1.6.0.20090820a-200909091600\jre\lib\fonts\LucidaBrightRegular.ttf”


Why does Aspose.Slides needs this path, it has nothing to do with Aspose??

Best regards.

Hi,

We are extremely sorry for your inconvenience. I have discussed the issue with development team. An Issue with ID 14897 has been created in our issue tracking system to further investigate the issue. This thread has also been associated with the this issue, so that you may be automatically notified, once issue is resolved.

Thanks and Regards,

The issues you have found earlier (filed as 14897) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.