Hello,
I am using the scheduler for employee scheduling. I am mainly using the tree mode of the timeline view. I am using the “round_position”(true) and “resize_events” (false) options and a custom text function.
Everything is working great in the calendar in the browser (see attachment). However, when I export it to a PDF, any row that has multiple events in a column, the events all overlap and are unreadable.
Any suggestions? Thanks!
Hi,
please, try to set bigger value in pdfGenerator.php for the follow option:
public $minTimelineSectionHeight = 50;
Hello,
Changing the value there does not seem to have any effect. Tried values from 5-100-500. I’m guessing it is because I have a large number of rows so it takes up the whole page and is always scaling to fit all rows on 1 page?
I tried adding some code to only show rows that have events in the current week, which worked and caused the rows with only 1 event per cell to get bigger, but the rows that had cells with more than 1 event stayed smaller, so I must be missing something…
Any other thoughts?
Hi,
please, update scheduler-pdf-php from attachment. For now this option will have effect.
scheduler-pdf-php.zip (628 KB)
Thanks! That worked better!
I made another change to your files. Rather than having a fixed size for each row, I modified it so that it was more a per-event height. So a row that had cells all with 1 height would be the $minTimelineSectionHeight. A row with a cell that had 2 events would be double the height, 3 events would be triple, etc. (I just changed the getTimelineSectionHeights to multiply the event Y by the relative height rather than add a relative height)
I’ve attached the code in case anyone is interested. It seems to add a bit of extra height to the rows that have cells with more than 1 event, but it is close enough for my purposes so I haven’t looked into it further.
I also added a few lines that hide any row which do not contain any events. If anyone uses my code and wants those lines to show, you can remove the “if(count($this->getEventsByWeek($i))>0)” lines in pdfGenerator.php
pdf.zip (630 KB)
One feature I’d like to request would be to have the text of the event wrap to the next line rather than truncate, but based on the way you are generating heights, etc I’m guessing this wouldn’t be too easy to implement.
Hi,
you may customize it yourself: you just should use MultiCell instead of Cell to draw event container in pdfWrapper.php (method drawTimelineEvents).
Here are links to Cell and MultiCell methods documentation:
tcpdf.org/doc/code/classTCPD … 29f8166f31
tcpdf.org/doc/code/classTCPD … c983ed3ece