PrintTask does not honour font styles

514
2
07-20-2017 08:30 AM
MatthieuThery1
Occasional Contributor

Hello,

I am having an issue with the print task:

Whenever I add a Graphics Layer with TextSymbols in it, add it to the map and try to print the different layers, the Text elements do print, but all the font styles are ignored.

The font size, style etc print as default (Arial, 10pt) etc. I have tried looking at the JSON passed, and everything looks fine and should actually work.

What I see on the map (font size to 50pt for demo) :

What I see on the printed map:

0 Kudos
2 Replies
JordanKing3
New Contributor III

Hey Matthieu,

Check that you're not using 'bolder' as the font-weight. I found that this broke the printing:

https://community.esri.com/thread/198924-supported-textsymbol-properties-in-print 

I also wonder if there are some other settings which break the printing...

Cheers,

Jordan

0 Kudos
MatthieuThery1
Occasional Contributor

Hi,

None of the style were actually applied (I tried many). I am working with Arc 10.4 and the API 3.21 .

I found a workaround though :

I am creating my own custom toolbox, instead of the ESRI built-in one, using ConvertWebMapToMapDocument.

The TextSymbols are converted into an Annotation class, and when looking at the attributes, none of the styles passed with the JSON were actually seen in the table (apart from the actual text).

I used arcpy.da.UpdateCursor to re-apply the styles to the annotation class before creating the pdf. It did not work. Apparently there is a bug/issue with this python function, and I had to revert back to the old arcpy.UpdateCursor to make it work. (Annotation and da.UpdateCursor  last message.)

I don't know if this is the function that they use in the built in print toolbox but that would explain the problem.

On map:

on Print :

Matthieu

0 Kudos