Details
-
Type:
Bug
-
Status: CLOSED
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.9.2, 10.0, 10.1
-
Component/s: Tests & Quizzes (Samigo)
-
Labels:
-
10 status:Resolved
-
Previous Issue Keys:SAM-2392
Description
In SAM-1106 it was fixed an issue when printing to pdf an assessment with HTML text which includes font changes.
We have found a happening of this issue not covered by the patch, related to PdfPTable objects.
The Description/Intro element in "Assessment Introduction" in Settings can be set as HTML and with a font-style medium or large it throws the Exception.
The involved code at PDFAssessmentBean.java is:
public ByteArrayOutputStream getStream() {
(...)
//parse out the elements from the html
ArrayList elementBuffer = HTMLWorker.parseToList(safeReader(head.toString()), style, props);
float[] singleWidth =
;
PdfPTable single = new PdfPTable(singleWidth);
single.setWidthPercentage(100f);
PdfPCell cell = new PdfPCell();
cell.setBorderWidth(0);
for (int k = 0; k < elementBuffer.size(); k++)
single.addCell(cell);
(...)
document.add(single);
document.add(Chunk.NEWLINE);
The Element object is not processed by FormattedText and it also crashes.
Gliffy Diagrams
Zeplin
Attachments
Issue Links
- is related to
-
SAK-36720 Error printing assesment as PDF
-
- Verified
-