Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70093

PDF dataformat export is misformatted when a cell height is greater than a page height

    XMLWordPrintable

Details

    Description

      When writing a row PDF dataformat calculates the height here:

      https://github.com/moodle/moodle/blob/58ba94a7290940391d1581e591a64fc7e6bb410a/dataformat/pdf/classes/writer.php#L140

      It fails when some cell is big enough to go to the next page, as `$pdf2->getY()` returns Y for the current (read `last`) page, but not the cell height.

      Screenshot:

      There are not many places in the moodle core that use pdf dataformat, so in order to provide this screenshot I put

      return "The user with id '$this->userid' viewed the log report for the course with id '$this->courseid'. Lorem ipsum dolor sit amet, vim ei impetus referrentur definitiones, duo ei quem repudiare dissentiunt. Duo ad choro volutpat quaerendum, erat posse alienum per ne. Nulla ceteros definitionem ne has, an ubique voluptatibus eum. Sea ei simul soluta signiferumque, has no illud atqui oportere. Saperet detraxit mnesarchum eos eu. Ea tempor corpora epicurei eam, ea modo sint reprehendunt sea, usu ex dicam impetus.";
      

      here: https://github.com/moodle/moodle/blob/58ba94a7290940391d1581e591a64fc7e6bb410a/report/log/classes/event/report_viewed.php#L73

       

      Update: This can be easily replicated using Forum export (see testing instruction).

      Attachments

        1. MDL-70093.jpg
          MDL-70093.jpg
          145 kB
        2. pdf_page_break_overlap.png
          pdf_page_break_overlap.png
          57 kB
        3. pdf not overlapping.png
          pdf not overlapping.png
          84 kB
        4. Screenshot_1.jpg
          Screenshot_1.jpg
          69 kB
        5. Screenshot_2.jpg
          Screenshot_2.jpg
          42 kB

        Issue Links

          Activity

            People

              mikhailgolenkov Mikhail Golenkov
              mikhailgolenkov Mikhail Golenkov
              Simey Lameze Simey Lameze
              Jake Dallimore Jake Dallimore
              Janelle Barcega Janelle Barcega
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 24 minutes
                  3h 24m