Symptom
- Text in a datasheet PDF is wider than in Excel and is cut off in narrow cells.
- In the PDF, File → Properties → Fonts lists
ArialMT/Arial-BoldMTinstead of the template's font (for exampleArialNarrow/ArialNarrow-Bold). - The SOCKETWorx log may show:
Font 'Arial Narrow' is not available for spreadsheets and PDFs on this server; 'Arial' is used instead.
Cause
SOCKETWorx produces PDFs on the web server and can only use fonts the server has. Some fonts used in templates, such as Arial Narrow, come with Microsoft Office rather than Windows, so a web server usually doesn't have them. When a font is missing, Arial is used in its place.
Resolution
Look in the SOCKETWorx site folder (the IIS site's physical path):
- It contains a
Fontsfolder with aREADME.rtf: use Option A. - No
Fontsfolder: use Option B, or update SOCKETWorx and use Option A.
Option A: Add the font to the SOCKETWorx Fonts folder (recommended)
- Get the font files. For Arial Narrow these are
ARIALN.TTF,ARIALNB.TTF,ARIALNI.TTFandARIALNBI.TTF. Copy them from a PC that has Microsoft Office, using a command prompt (Explorer's Fonts window doesn't copy font files properly):copy C:\Windows\Fonts\ARIALN*.TTF C:\Temp\ArialNarrow\Copy - Copy the files into the site's
Fontsfolder on the server, next toREADME.rtf. For example:
Replace the path with your site's folder.Copy-Item C:\Temp\ArialNarrow\ARIALN*.TTF "C:\inetpub\SOCKETWorx\Fonts\"Copy - Recycle the SOCKETWorx application pool (IIS Manager → Application Pools → select the pool → Recycle).
GemBox:FontsFolder in appsettings.json to another folder, for example "GemBox": { "FontsFolder": "D:\\SOCKETWorxFonts" }.Option B: Install the font in Windows for all users
Run in a PowerShell window opened as Administrator on the web server, from the folder holding the font files.
- Copy the files into the Windows Fonts folder:
Copy-Item .\ARIALN*.TTF C:\Windows\Fonts\ -ForceCopy - Register them for the machine:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Arial Narrow (TrueType)" /t REG_SZ /d ARIALN.TTF /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Arial Narrow Bold (TrueType)" /t REG_SZ /d ARIALNB.TTF /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Arial Narrow Italic (TrueType)" /t REG_SZ /d ARIALNI.TTF /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Arial Narrow Bold Italic (TrueType)" /t REG_SZ /d ARIALNBI.TTF /fCopy - Check both.Each command must show four items:
dir C:\Windows\Fonts\ARIALN*.TTFCopyreg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /f "Arial Narrow"Copy - Recycle the SOCKETWorx application pool.
dir command above to check, not Explorer.Verify
Download a datasheet PDF again and open File → Properties → Fonts.
ArialNarrow and ArialNarrow-Bold ("Embedded Subset").If PDFs still use Arial
Datasheet PDFs are produced by background jobs. Any SOCKETWorx instance connected to the same database can run them, including a test server or a developer PC. Open https://<your site>/hangfire/servers: every server listed must belong to the web server where you added the font. Shut down any other instance, or add the font there as well.
Notes
- Licensing: fonts are licensed software. Arial Narrow is licensed with Microsoft Office; confirm your licensing covers using a font on the server before copying it there.
- Other fonts: the same steps apply to any font a template uses. Copy that font's
.ttf,.otfor.ttcfiles. - Page breaks are a separate topic: if PDF pages split at a different column or row than Excel shows, add manual page breaks to the template in Excel (View → Page Break Preview), then load it with Replace Template File in Datasheet Templates → Modify Properties.
