Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: PDF function error: "Platform, Locale, and Platform Name must not be null"

$
0
0

I've created a cfm page that enumerates all the fonts in the c:\windows\fonts directory and lists the ones that are incompatible with the CF PDF components:

 

<cfset fontobj = createobject("java","com.adobe.fontengine.fontmanagement.FontLoader") >

<cfdirectory action="list" directory="c:\windows\fonts" name="fontdir">

 

 

<table border="1" style="border-collapse:collapse">

  <tr>

    <th>Font Name:</th>

    <th>Error</th>

  </tr>

  <cfloop query="fontdir">

  <cftry>

    <cfset loaded = fontobj.load(createobject("java","java.net.URL").init("file:///C|/win dows/fonts/#fontdir.name#"))>

    <cfif arraylen(loaded) gt 0>

      <cfset dummy="#loaded[1].getPlatformFontDescription()[1].toString()#" >

    </cfif>

    <cfcatch>

      <cfif findnocase("platform",cfcatch.message)>

        <tr>

          <td><cfoutput>#fontdir.name#</cfoutput></td>

          <td><cfoutput>#cfcatch.message#</cfoutput></td>

        </tr>

      </cfif>

    </cfcatch>

  </cftry>

  </cfloop>

</table>

 


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>