主要内容

exportToPDF

R2026b

Export fault trees and fault tree documents to PDF

Since R2026b

Description

exportToPDF(faultTreeDocument) exports the specified fault tree document in the Safety Analysis Manager to a PDF. The function exports each fault tree in the document to a separate page in the PDF.

example

exportToPDF(faultTree) exports the specified fault tree to a PDF.

example

exportToPDF(___,fileFolder) exports the fault tree or fault tree document to the folder, fileFolder.

example

exportToPDF(___,fileName) exports the fault tree or fault tree document with the file name, fileName.

example

Examples

collapse all

Suppose you have one fault tree document open. To export the fault tree document as a PDF, retrieve the FaultTreeDocument object for the document.

myTreeDoc = safetyAnalysisMgr.getCurrentDocument;

Export the fault tree document to a PDF in the working folder.

exportToPDF(myTreeDoc)

Suppose you have one fault tree document open and it contains two fault trees. To export the first fault tree document as a PDF, retrieve the FaultTreeDocument object for the document.

myTreeDoc = safetyAnalysisMgr.getCurrentDocument;

Retrieve the first fault tree in the fault tree document.

myTree = myTreeDoc.FaultTrees(1);

Export the fault tree to a PDF in the working folder.

exportToPDF(myTree)

Suppose you have one fault tree document open, and you want to save it to a custom folder, C:/files/myTreePDFs. Retrieve the FaultTreeDocument object for the document.

myTreeDoc = safetyAnalysisMgr.getCurrentDocument;

Export the fault tree document to the C:/files/myTreePDFs folder.

exportToPDF(myTreeDoc,"C:/files/myTreePDFs")

Suppose you have one fault tree document open, and you want to save it to a custom folder, C:/files/myTreePDFs, with a custom name. Retrieve the FaultTreeDocument object for the document.

myTreeDoc = safetyAnalysisMgr.getCurrentDocument;

Export the fault tree document to the C:/files/myTreePDFs folder with the name myFaultTreeDoc.pdf.

exportToPDF(myTreeDoc,"C:/files/myTreePDFs/myFaultTreeDoc.pdf")

Input Arguments

collapse all

Fault tree document in the Safety Analysis Manager, specified as a FaultTreeDocument object.

Fault tree in the Safety Analysis Manager fault tree document, specified as a FaultTree object.

Folder path at which to save the generated PDF, specified as a string scalar or character vector. If you do not specify this argument, the function saves the file in the current folder.

Note

If the specified folder contains a PDF that has the same file name, the function overwrites the file.

Data Types: char | string

File name, specified as a string scalar or character vector.

Data Types: char | string

Version History

Introduced in R2026b