Access to path is denied- please help

Hello,

I am trying to save a word document as a pdf and I set the necessary permissions to allow the files to be written to the destination folder. This working fine when I save a Word document to that folder, however, when I try to save as a PDF I am getting a totally different error that forces authentication and references a path outside my webroot…

Access to the path ‘C:\Program Files\Adaptec\Adaptec Storage Manager\jre\lib\fonts\LucidaBrightRegular.ttf’ is denied.
… I am on a shared host. The code works perfectly on my local server, it’s only when I try to deploy it to the shared hosting environment. Here is my C# code…

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.Words;

public partial class Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Document doc = new Document(@"D:\Webs\fast700002\Clients\Contracts\Template\contract.doc");
        doc.Save(@"D:\Webs\fast700002\Clients\Contracts\PDF\contract.pdf", SaveFormat.Pdf);
    }
}

Why is it referencing…

C:\Program Files\Adaptec\Adaptec Storage Manager\jre\lib\fonts\LucidaBrightRegular.ttf

…I talked to my hosting company (Verio) and they said that’s a path on my local system. But that path doesn’t exist on my system either. They are putting the blame back on me and ASPOSE.

You can view the page here…

… for some reason it is forcing authentication, only for this page though, you need to hit ‘Cancel’ to see the actual error.

Has anyone else had a problem like this? I’m not sure what to do or how
to tell my hosting company how to fix it. Please advise, this is
extremely important.

Thanks in advance,

Lee

Hi

Thanks for your request. The problem might occur because Aspose.Words cannot read font. During converting to PDF Aspose.Words should read all fonts used in the original document to create font subset, which will be stored in the output PDF file.

Most likely, you have no permissions to read fonts on your hosting environment. I think, you can ask your hosting to allow you to read fonts installed on the server.

Best regards.

Thanks,

I have asked my hosting company and am awaiting their reply. One thing though, I created a doc with only one word and it is in times new roman and I still get the same message. So I’m not even using the font it’s trying to access.

Hi

Thanks for your request. Times New Roman is also a font, and Aspose.Words should read it as well to create subset of this font. And since you have no right to read fonts on your server environment you get the same error message.

I suppose conversion works fine on your developer machine, where you have right to read fonts.

Best regards.

Hello.

You can use FontSettings class to specify the fonts folder explicitly.

Since the initial issue is not a bug of AW it doesn’t make sense now.