// Use this for initialization void Start() { beniAudio = GameObject.FindGameObjectWithTag("BeniAudio").GetComponent <AudioSource>(); rend = GetComponent <Renderer>(); generator = GameObject.FindGameObjectWithTag("GameController").GetComponent <GenerateWord>(); selection = gameObject.GetComponent <TextMesh>(); }
public static void SaveAll(Document doc, string path) { try { MigraDoc.Rendering.PdfDocumentRenderer docRend = new MigraDoc.Rendering.PdfDocumentRenderer(false); docRend.Document = doc; docRend.RenderDocument(); string someName = GenerateWord.Generate(4); string FileName = "rel" + someName + ".pdf"; docRend.PdfDocument.Save(path + "\\" + FileName); System.Diagnostics.ProcessStartInfo procInfo = new System.Diagnostics.ProcessStartInfo(); procInfo.FileName = path + "\\" + FileName; System.Diagnostics.Process.Start(procInfo); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Ocorreu algo errado", "Aviso", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); throw ex; } }