Free Support Forum - aspose.com

Incorrect Font Showing

We are moving an old website across to a windows 2012 server. The website uses aspose.pdf to create reports and this works fine on the old server.

However when we try the same code on the new server the font that is being specified is being ignored and replaced by courier.

The example code below is what is generating the PDF.

<?xml version=""1.0"" encoding=""UTF-8""?>
<Pdf xml:space=""preserve"" TabStopPosition=""36"" IsCoreFontUsed=""false"" IsPageNumberForDocument=""true"" xmlns=""Aspose.Pdf"">
  <Section PageWidth=""595.3"" PageHeight=""841.9"" PageMarginTop=""72"" PageMarginBottom=""72"" PageMarginLeft=""54"" PageMarginRight=""28.35"" IsNewPage=""false"">
    <Header MarginTop=""35.45"" IsSubsequentPagesOnly=""true"">
      <Text IsSpaced=""true"" Alignment=""Center"" LineSpacing=""5.8"">
        <Segment FontName=""Tahoma"" Color=""rgb 204 0 0"" IsTrueTypeFontBold=""true"" FontSize=""8"">                                                                                                              </Segment>
        <Segment FontName=""Tahoma"" Color=""rgb 204 0 0"" IsTrueTypeFontBold=""true"" FontSize=""8"">" + "Personal Profile" + @"</Segment>
        <Segment FontName=""Tahoma"" Color=""rgb 204 0 0"" IsTrueTypeFontBold=""true"" FontSize=""8"">||SubjectNameHeader||</Segment>
      </Text>

Does anyone know what might be causing this or how we can get around this.

@ldebna

Thanks for contacting support.

Please note that, in order to use specified fonts in a PDF document, these fonts should be present/installed in the machine where PDF is being generated. Please make sure that you have specific fonts installed in your environment and try again. In case issue still persists, please let us know.

Furthermore, it seems you are using an older version of the API and using Aspose.Pdf.Generator approach. Please note that, Aspose.Pdf.Generator has been removed and discontinued in new version of the API and we are not resolving issues or providing support for older approach. You may please upgrade your methods and XML template according to new Aspose.Pdf DOM (Document Object Model) approach (Aspose.PDF for .NET 18.6), by checking following useful articles in API Documentation:

Hi there, thanks for coming back to me. Unfortunately upgrading is out of scope currently because we do not have all of the source code.

I have checked the fonts and these are all installed on the server.

Are there any know problems with the version we are using on Windows server 2012?

Thanks
Lee

@ldebna

Thanks for writing back.

There are no such known issues in our API regarding running on Windows Server 2012. However, as you are using an old version of the API, I am afraid we cannot suggest any workaround unless we are able to replicate the issue with latest version of the API. Please note that issues reported for older versions of the API, are resolved in latest version, which is why we always recommend our customers to use latest version.

Concerning to replicate the issue with latest version, would you please share complete XML template with us. We will try to convert it according to new DOM model, in order to test the scenario in our environment and address it accordingly.