ef AddCustomPaper(paper, width, height, id_number):
paper_path = forms_path + "\\" + paper
custom_papers_reg = Registry.LocalMachine.OpenSubKey(forms_path)
if custom_papers_reg is not None:
pass
else:
Registry.LocalMachine.CreateSubKey(forms_path)
paper_reg = Registry.LocalMachine.OpenSubKey(paper_path)
if paper_reg is not None:
pass
else:
Registry.LocalMachine.CreateSubKey(paper_path)
paper_reg = Registry.LocalMachine.OpenSubKey(paper_path, True)
paper_reg.SetValue("ID", id_number + 211, RegistryValueKind.DWord)
paper_reg.SetValue("Units", 2, RegistryValueKind.DWord)
paper_reg = Registry.LocalMachine.OpenSubKey(paper_path, True)
paper_reg.SetValue("Width", int(width) * 1000, RegistryValueKind.DWord)
paper_reg.SetValue("Height", int(height) * 1000, RegistryValueKind.DWord)
paper_reg.Close()