Issues after upgrading to 1.5.16


#1

After putting in the new dll 1.5.16 I’ve run into a lot of font errors, that I did not have with previous versions (1.5.15 and earlier). The first issue was a “Resource Category FontPFM not found” I fixed this by including the FontPFM file in the code & xml, but I’m curious as to why this is a problem all of a sudden.

The current issue that I’m having now is the following error:

Metrics data for font ‘Shelley Allegro Script’ not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ApplicationException: Metrics data for font ‘Shelley Allegro Script’ not found.

Source Error:

Line 98: End Try
Line 99:
Line 100: pdf2.SaveWeb(Response)
Line 101: Response.End()
Line 102:

Source File: d:\sites\ami\print_profile.aspx.vb Line: 100

Stack Trace:

[ApplicationException: Metrics data for font ‘Shelley Allegro Script’ not found.]
dj.a(fj A_0, String A_1, String A_2, Int32 A_3, Boolean A_4, Boolean A_5, String A_6, Boolean A_7) +2500
fj.a(String A_0, String A_1, String A_2, String A_3, Int32 A_4, Boolean A_5, Boolean A_6, String A_7, Boolean A_8) +552
e2.a(Pdf A_0, Section A_1, Table A_2, Row A_3, Cell A_4, Text A_5, String A_6, a A_7, ck A_8) +845
cd.a(Pdf A_0, Section A_1, Table A_2, Row A_3, Cell A_4, Text A_5, a A_6, ck A_7, Boolean A_8) +1932
b9.a(Pdf A_0, Section A_1, a A_2) +779
bo.a(Pdf A_0) +319
am.a(ax A_0, Pdf A_1) +44
Aspose.Pdf.Pdf.SaveWeb(HttpResponse response) +43
AMI.print_profile.DesignProfile() in d:\sites\ami\print_profile.aspx.vb:100
AMI.print_profile.Page_Load(Object sender, EventArgs e) in d:\sites\ami\print_profile.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Like I said before if I use dll 1.5.15 or anything prior I do not have this problem at all, but the problem is that if I use 1.5.15 my clients receive “Invalid Directory” issues when trying to generate PDF files (I’m assuming this relates back to the previously reported BindXML issue).

How can I fix this issue? Below are snippets of my code & xml
----- Defining a font in VB.NET -----
Dim cell2 As Cell
cell2 = row1.Cells(1)
Dim text1Cell2 As Text
text1Cell2 = New Text(section)
cell2.Paragraphs.Add(text1Cell2)
Dim seg1Text1Cell2 As Segment
seg1Text1Cell2 = New Segment(text1Cell2)
text1Cell2.Segments.Add(seg1Text1Cell2)
seg1Text1Cell2.Content = “Your " & dsUserAttributes.Tables(“StyleAttributes”).Rows(intCounter3)(“strFamilyName”) & " is”
seg1Text1Cell2.TextInfo.FontSize = 20
seg1Text1Cell2.TextInfo.FontName = “Garamond-BookCondensed”
seg1Text1Cell2.TextInfo.FontAfmFile = “D:\Fonts\GAWC____.afm”
seg1Text1Cell2.TextInfo.FontOutlineFile = “D:\Fonts\GAWC____.pfb”
seg1Text1Cell2.TextInfo.FontPfmFile = “D:\Fonts\GAWC____.pfm”
seg1Text1Cell2.TextInfo.FontEncodingFile = “D:\Fonts\cp1250.txt”
seg1Text1Cell2.TextInfo.FontEncoding = “cp1250”
seg1Text1Cell2.TextInfo.IsFontEmbedded = True
seg1Text1Cell2.TextInfo.Alignment = AlignmentType.Left

----- Defining a Font in XML -----

<Segment FontSize=“22” FontName=“Shelley Allegro Script” FontEncoding=“cp1250”
IsFontEmbedded=“true” FontAfmFile=“D:\Fonts\SHAL____.afm”
FontOutlineFile=“D:\Fonts\SHAL____.pfb” FontPFMFile=“D:\Fonts\SHAL____.PFM” FontEncodingFile=“D:\Fonts\cp1250.txt”>
The Truth About


Thank you for your help.



#2

Dear Brianm,

Thanks for your consideration.

I have tested the “Garamond-BookCondensed” font, removed the FontPfmFile and haven’t fount any error. I have no “Shelley Allegro Script” font to test.

Please make sure you have updated the hot fix properly. If it still can’t work, please send me a complete example(code or xml) to test.

The following is my test code which works fine:

--------------------------------------------------------
Dim apdf As Pdf = New Pdf()

Dim sec As Section = New Section()
apdf.Sections.Add(sec)

Dim tab1 As Table = New Table()
sec.Paragraphs.Add(tab1)

Dim row1 As Row = New Row(tab1)
tab1.Rows.Add(row1)

Dim cell2 As Cell = New Cell(row1)
row1.Cells.Add(cell2)
Dim text1Cell2 As Text
text1Cell2 = New Text(sec)
cell2.Paragraphs.Add(text1Cell2)
Dim seg1Text1Cell2 As Segment
seg1Text1Cell2 = New Segment(text1Cell2)
text1Cell2.Segments.Add(seg1Text1Cell2)
seg1Text1Cell2.Content = "Your "
seg1Text1Cell2.TextInfo.FontSize = 20
seg1Text1Cell2.TextInfo.FontName = “Garamond-BookCondensed”
seg1Text1Cell2.TextInfo.FontAfmFile = “Y:\c#\customer\brianm\GAWC____.afm”
seg1Text1Cell2.TextInfo.FontOutlineFile = “Y:\c#\customer\brianm\GAWC____.pfb”
'seg1Text1Cell2.TextInfo.FontPfmFile = “Y:\c#\customer\brianm\GAWC____.pfm”
seg1Text1Cell2.TextInfo.FontEncodingFile = “Y:\c#\customer\brianm\cp1250.txt”
seg1Text1Cell2.TextInfo.FontEncoding = “cp1250”
seg1Text1Cell2.TextInfo.IsFontEmbedded = True
seg1Text1Cell2.TextInfo.Alignment = AlignmentType.Left

Dim cell1 As Cell = New Cell(row1)
row1.Cells.Add(cell1)
Dim text1Cell1 As Text
text1Cell1 = New Text(sec)
cell1.Paragraphs.Add(text1Cell1)
Dim seg1Text1Cell1 As Segment
seg1Text1Cell1 = New Segment(text1Cell1)
text1Cell1.Segments.Add(seg1Text1Cell1)
seg1Text1Cell1.Content = “Your 2”
seg1Text1Cell1.TextInfo.FontSize = 20
seg1Text1Cell1.TextInfo.FontName = “Garamond-BookCondensed”
seg1Text1Cell1.TextInfo.FontAfmFile = “Y:\c#\customer\brianm\GAWC____.afm”
seg1Text1Cell1.TextInfo.FontOutlineFile = “Y:\c#\customer\brianm\GAWC____.pfb”
'seg1Text1Cell2.TextInfo.FontPfmFile = “Y:\c#\customer\brianm\GAWC____.pfm”
seg1Text1Cell1.TextInfo.FontEncodingFile = “Y:\c#\customer\brianm\cp1250.txt”
seg1Text1Cell1.TextInfo.FontEncoding = “cp1250”
seg1Text1Cell1.TextInfo.IsFontEmbedded = True
seg1Text1Cell1.TextInfo.Alignment = AlignmentType.Left

apdf.Save(“d:/temp/test.pdf”)




#3

Well it’s still failing on the Shelly font so the above code doesn’t help. If I send you the font would you be able to test it then, hopefully that’s all you need to reproduce the error. I’m still curious as to why there weren’t any problems in 1.5.15 and earlier and now there are issues with 1.5.16.

Where should I email the font files to?

Thank you.


#4

Actually now I just removed all references to the Shelly Allegro Script font and I’m receiving the same “Metrics data for font ‘Garamond-BookCondensed’ not found” not found…


#5

Dear Brianm,

Thanks for your consideration.

Please send your fonts and a complete example to pdf@aspose.com.



#6

Email sent with all fonts, dll, license, xml, & .aspx/.vb files included.

Let me know if you need anything else.

Thank you.


#7

Dear Brianm,

Thanks for your consideration.

Please download hot fix in thread New Release 1.5 and Its Hot Fixes.


#8

Dear Brianm,

Thanks for your consideration.

I noticed you have used Pdf.SaveWeb method. I have changed this method back to Pdf.Save with more parameters.

Pdf.Save(HttpResponse) method is obsolete and will be removed in August 2004. A new method Pdf.SaveWeb(string,SaveType,HttpResponse) is add. Pdf.Save(HttpResponse) forces windows application users to “using System.Web”, so we have to replace it with Pdf.SaveWeb(string,SaveType,HttpResponse). Please view our new api reference for detail.

I apologize for the inconvenience you have experienced.