Boolean result to PDF
This script executes boolean (sub, or) operation on the specified layers, and then the result is output as a PDF.
Download here. (boolean_pdf_out.py)
Script
# Open the file with rotate
input_data = "/path/to/input"
rotate = 90
input = pynebv.file.open(input_data, opts={"rotate":rotate})
# Get layer
layer_1 = input.layer(1)
layer_2 = input.layer(2)
layer_3 = input.layer(3)
# Get outline before boolean operation
outlined = True
# Boolean (sub)
sub_target ={"itemList":layer_2, "outline":outlined}
sub_result = pynebv.figure.boolean(layer_1, outlined, subtrahend=sub_target, operation='SUB')
# Boolean (or)
or_result = pynebv.figure.boolean([sub_result, layer_3], outlined, operation="OR")
# Close unnecessary files
input.close()
sub_result.close()
# Output PDF from screen
output_name = "output.pdf"
paper_size = "A4"
resolution = 800
scale_type = "Fit Paper Size" # "Full Scale" or "Fit Paper Size"
with_header = True
pynebv.screen.plot(output_name, outputType="PDF", sheet=paper_size, reso=resolution, scaleType=scale_type, withHeader=with_header)
How to Use
$ nebv --python-file /path/to/script.py
Results
Output File
PDF file
Console
None
Last modified August 18, 2026