How to change the results format to line by line in pdf

Hi James,

I was using the planar imaging module.

At the console, pylinac is able to print the results line by line.

When we use the publish_pdf method, the results are formatted in a single line and truncated in the pdf.

Is there a way to save the results line by line in the pdf?


Ack, it looks like the newline character isn’t being respected. I will fix that in the next version. To fix it currently you can edit the source code to comment out this line: pylinac/ at master · jrkerns/pylinac (
or override the results() method to do the same thing in a custom subclass. This will make the console version return a list of strings however. My fix will look like this so it works in both cases: pylinac/ at master · jrkerns/pylinac (

Hi James,

Thanks for fixing this in v3.5.

I have found the text results of the low contrast count inconsistent with the diagram count. Our ssd = 1600

Attached is the image and pdf report.


00072595 (2 MB)

Leeds.pdf (168 KB)

Hi LipTeck,
Thanks for the heads up. This is because the plot is showing the “visibility”, which takes into account the ROI size for phantoms like Las Vegas, and the previous simple contrast. This appears to affect all planar analyses. I will change it to be consistent and use the visibility for both result and plot. The previous metric is still available and I will add a note in the changelog how to access it if that metric is still desired.


Hi James,

Is it possible to crop 2 cm from the edge of the phantom image for report?
Thank you!


leeds = pylinac.LeedsTOR.from_demo_image()
leeds.image.crop(pixels=int(round(20*leeds.image.dpmm)), edges=(‘left’,)) # choose the edge(s) you prefer
leeds.publish_pdf(‘cropped.pdf’, open_file=True)

Hi James,


How do we adjust the window and level of the image for optimal report viewing?

Lip Teck

Unfortunately, there is no easy way to pass those in at the moment. However in the next release (3.6, due just before Christmas) or if you install directly from github you’ll be able to do the following for the planar module. No other module has this at the moment:

class WLLeeds(pylinac.LeedsTOR):

def window_floor(self) → Optional[float]:
return 0.3 # set this to whatever you like

def window_ceiling(self) → Optional[float]:
return 0.5

leeds = WLLeeds.from_demo_image()
leeds.publish_pdf(‘windowlevel.pdf’, open_file=True)

Oops, I misunderstood my own diff. It’s in 3.5 already.