Ejemplo n.º 1
0
def save_as_pdf(draft, open):
    """Print draft as pdf in a local folder in the Dowloads folder.
    """
    print("---")

    print("Drawing: %s" % draft.name)
    assert draft.name.lower().endswith(".dft"), (
        "This macro only works on Drawing document not %s" % draft.name[-4:])
    pdf_file = draft.name[:-4] + ".pdf"

    print("PDF    : %s" % pdf_file)
    root_download = userprofile() + "\\Downloads" + "\\solidedgePDFs\\"
    if not is_exist(root_download):
        makedirs(root_download)

    # Save the pdf in Downloads/solidedgePDFs.
    new_name = combine(root_download, pdf_file)
    draft.SaveAs(NewName=new_name, FileFormat=False)
    if open:
        Start(new_name)  # Open the pdf.
    print("saved in %s" % root_download)
    print("...")
Ejemplo n.º 2
0
 def Hyperlink_RequestNavigate(self, sender, e):
     """Forwarding for a Hyperlink"""
     Start(e.Uri.AbsoluteUri)