Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
moodle-assignfeedback_editpdfplus
Commits
8c6faf7d
Commit
8c6faf7d
authored
Apr 16, 2018
by
M. Chardon
Browse files
correction défaut tampons dans PDF généré
parent
5297f2f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
classes/document_services.php
View file @
8c6faf7d
...
...
@@ -751,10 +751,6 @@ EOD;
// Need to generate the page images - first get a combined pdf.
$document
=
self
::
get_combined_pdf_for_attempt
(
$assignment
,
$userid
,
$attemptnumber
);
/* $file = self::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
if (!$file) {
throw new \moodle_exception('Could not generate combined pdf.');
} */
$status
=
$document
->
get_status
();
if
(
$status
===
combined_document
::
STATUS_FAILED
)
{
...
...
@@ -794,13 +790,8 @@ EOD;
for
(
$i
=
0
;
$i
<
$pagecount
;
$i
++
)
{
$pdf
->
copy_page
();
//$comments = page_editor::get_comments($grade->id, $i, false);
$annotations
=
page_editor
::
get_annotations
(
$grade
->
id
,
$i
,
false
);
/* foreach ($comments as $comment) {
$pdf->add_comment($comment->rawtext, $comment->x, $comment->y, $comment->width, $comment->colour);
} */
foreach
(
$annotations
as
$annotation
)
{
$pdf
->
add_annotation
(
$annotation
,
$annotation
->
path
,
$stamptmpdir
,
$compteur
);
if
(
$annotation
->
textannot
&&
!
$annotation
->
parent_annot
)
{
...
...
classes/pdf.php
View file @
8c6faf7d
...
...
@@ -505,12 +505,25 @@ class pdf extends \FPDI {
$h
=
self
::
MIN_ANNOTATION_HEIGHT
;
}
$this
->
SetXY
(
$sx
,
$sy
);
$colourcartridge
=
$toolObject
->
colors
;
if
(
!
$colourcartridge
)
{
$colourcartridge
=
$typetool
->
color
;
}
$colourcartridgearray
=
$this
->
get_colour_for_pdf
(
$colourcartridge
);
$this
->
SetTextColorArray
(
$colourcartridgearray
);
$cartouche
=
$toolObject
->
label
;
//$this->Cell($w);
//Texte centré dans une cellule 20*10 mm encadrée et retour à la ligne
$this
->
Cell
(
strlen
(
$cartouche
)
*
6
+
4
,
10
,
$cartouche
,
1
,
1
,
'C'
);
break
;
default
:
// Line.
$this
->
Line
(
$sx
,
$sy
,
$ex
,
$ey
);
break
;
}
if
(
$type
==
'stampplus'
||
$type
==
'commentplus'
||
$type
==
'stampcomment'
||
(
$type
==
'frame'
&&
!
$annotation
->
parent_annot
)
||
$type
==
'verticalline'
||
$type
==
'highlightplus'
)
{
if
(
$type
==
'commentplus'
||
$type
==
'stampcomment'
||
(
$type
==
'frame'
&&
!
$annotation
->
parent_annot
)
||
$type
==
'verticalline'
||
$type
==
'highlightplus'
)
{
$cartouche
=
$toolObject
->
cartridge
;
if
(
$annotation
->
textannot
)
{
$cartouche
.
=
' ['
.
$annotation_index
.
']'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment