View Issue Details

IDProjectCategoryView StatusLast Update
0016068ScribusPDFpublic2020-04-05 19:37
ReporterPontobart Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.6.svn 
Target VersionFixed in Version1.5.6.svn 
Summary0016068: PDF analyzer fails on dash pattern and type0 fonts
DescriptionThe d operator has the form "dashArray dashPhase".
For the tf operator with Type0 fonts the DescendantFonts key points to an array holding one reference to the descendant font. One has to resolve the reference and not use it directly.

Example from a PDF file:

/Type /Font
/BaseFont /ABCDEE+FontName
/DescendantFonts 15 0 R
/Encoding /Identity-H
/Subtype /Type0
/ToUnicode 21 0 R
>>
endobj
15 0 obj
[ 16 0 R ]
endobj
16 0 obj
<<
/Type /Font
/BaseFont /ABCDEE+FontName
/CIDSystemInfo 17 0 R
/CIDToGIDMap /Identity
/DW 1000
/FontDescriptor 18 0 R
/Subtype /CIDFontType2
/W 20 0 R
>>


TagsNo tags attached.
PatchNo

Activities

Pontobart

2020-03-19 07:01

reporter  

pdf_analyze_errors_pattern_type0_fonts.diff (1,368 bytes)
Index: scribus/pdf_analyzer.cpp
===================================================================
--- scribus/pdf_analyzer.cpp	(Revision 23509)
+++ scribus/pdf_analyzer.cpp	(Arbeitskopie)
@@ -278,7 +279,7 @@
 					PdfArray dashArr = args[0].GetArray();
 					for (uint i=0; i<dashArr.size(); ++i)
 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
-					currGS.dashPattern.second = args[0].GetNumber();
+					currGS.dashPattern.second = args[1].GetNumber();
 					}
 					break;
 				case KW_g:
@@ -780,10 +781,10 @@
 			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
 			if (descendantFonts && descendantFonts->IsArray())
 			{
-				PdfObject descendantFont = descendantFonts->GetArray()[0];
-				descendantFont.SetOwner(descendantFonts->GetOwner());
-				PdfObject* subtypeDescFont = descendantFont.GetIndirectKey("Subtype");
-				fontDesc = descendantFont.MustGetIndirectKey("FontDescriptor");
+				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
 				if (subtypeDescFont && subtypeDescFont->IsName())
 				{
 					if (subtypeDescFont->GetName() == "CIDFontType0")

jghali

2020-03-19 09:55

administrator   ~0047442

I've applied your patch, thanks!

Issue History

Date Modified Username Field Change
2020-03-19 07:01 Pontobart New Issue
2020-03-19 07:01 Pontobart File Added: pdf_analyze_errors_pattern_type0_fonts.diff
2020-03-19 09:55 jghali Assigned To => jghali
2020-03-19 09:55 jghali Status new => resolved
2020-03-19 09:55 jghali Resolution open => fixed
2020-03-19 09:55 jghali Fixed in Version => 1.5.6.svn
2020-03-19 09:55 jghali Note Added: 0047442
2020-04-05 19:37 cbradney Status resolved => closed