CFPDFForm Populate Error - java.lang.NullPointerException: Platform, Locale, and Platform Name must not be null

ぃ、小莉子 提交于 2019-12-01 19:49:58

I wrote a script that will parse all the font files in c:\windows\fonts and report back on the bad ones:

<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|/windows/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>

I had the same issue too right after the installation of CS6.0.

Platform:

  • CF9.0
  • Win 7
  • CS6 (obviously)

Through trial and error, as stated above and a good few restarts of coldfusion I've whittled it down to the following font files that you can uninstall via font manager by going to C:\Windows\Fonts :-

  • AdobeNaskh-Medium.otf
  • MyriadArabic-Bold.otf
  • MyriadArabic-BoldIt.otf
  • MyriadArabic-It.otf
  • MyriadArabic-Regular.otf

Hope this helps someone. Took me a fair few hours to fix this "niggle".

The workaround on the reported bug solved the issue. Thanks Miguel-F

The workaround is: "delete all fonts installed with the same date as your creative cloud 6 app installations or uninstall creative could 6"

had the same issue myself.

My solution (which compliments the above correct answer): Here's the list of fonts that Adobe installs with the Creative Suite 6: http://www.adobe.com/type/browser/fontinstall/cs6installedfonts.html

  1. Copy all these fonts to the separate folder and remove from the Windows/Fonts directory.
  2. Test CFPDFFORM bit and confirm it's working
  3. Manually add them back.

In my case it turned out none of those fonts were corrupt per se, though probably weren't installed the way Windows like it. Re-installing it manually somewhat fixed the issue.

One more note: I've removed all until MyriadPro (including it) constantly refreshing the page containing CFPDFFORM bit until it worked. So for those trying to get a fast fix, I'd recommend starting with MyriadPro family. It just may turn out it's the one that breaks the things.

Hope this helps someone out!

/////////////// UPDATED 7/02/2014 ///////////////////////////////////////////////////////////////////

It turns out I am not able to comment until certain number of points will be acquired, therefore I'm not able to say how much Jesse Carlton's answer (above) helped me out.

Here's one more step that solved me the bug:

  1. It turns out that some of the Adobe installed fonts have name values as null, hence failing the cfpdfform badly. To find those files use the script that Jesse Carlton created (again, it's above in one of the answers)

  2. At least in my case all those fonts had duplicate values (normal and _0 ones). Normal values were visible and easy to remove using Windows font manager. However, the _0 ones weren't visible.

  3. Download software like FontExpert2014 (or any other font manager for that matter) and locate those files that you couldn't see in the windows font manager.

  4. To check whether all of the corrupt fonts are removed run the script from the step 1 again. When you'll get the empty table, try cfpdfform bit that was failing you previously and all should be good.

*the software from the step 3 was downloaded as evaluation version and did the trick for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!