private void LoadDefaults() { ExportSWFParams ex = new ExportSWFParams(); chkAddPageStop.Checked = ex.AddPageStop; chkEnableLinks.Checked = ex.EnableLinks; chkFlattenSWF.Checked = ex.FlattenSWF; chkFontsToShapes.Checked = ex.FontsToShapes; chkIgnoreDrawOrder.Checked = ex.IgnoreDrawOrder; chkOpenInNewWindow.Checked = !ex.OpenLinksInSameWindow; chkStoreFonts.Checked = ex.StoreFonts; cboFlashVersion.Text = ex.FlashVersion.ToString(); optPolyToBitmap.Checked = ex.PolyToBitmap; optFullBitmap.Checked = ex.ToFullBitmap; txtLoaderSWF.Text = ex.Loader; txtViewerSWF.Text = ex.Viewer; }
private void btnExport_Click(object sender, EventArgs e) { btnExport.Enabled = false; _doc.ExportSwfProgress += new PDFLibNet.ExportJpgProgressHandler(_doc_ExportSwfProgress); _doc.ExportSwfFinished += new PDFLibNet.ExportJpgFinishedHandler(_doc_ExportSwfFinished); ExportSWFParams ex = new ExportSWFParams(); ex.AddPageStop = chkAddPageStop.Checked; ex.DefaultLoaderViewer = string.IsNullOrEmpty(txtLoaderSWF.Text) && string.IsNullOrEmpty(txtViewerSWF.Text); ex.EnableLinks = chkEnableLinks.Checked; int flashVersion = 9; if (int.TryParse(cboFlashVersion.Text, out flashVersion)) { ex.FlashVersion = (short)flashVersion; } ex.FlattenSWF = chkFlattenSWF.Checked; ex.FontsToShapes = chkFontsToShapes.Checked; ex.IgnoreDrawOrder = chkIgnoreDrawOrder.Checked; ex.LinksColor = string.Format("{0:x}{1:x}{2:x}", colorPicker1.Color.R, colorPicker1.Color.G, colorPicker1.Color.B); ex.Loader = txtLoaderSWF.Text; ex.OpenLinksInSameWindow = !chkOpenInNewWindow.Checked; if (optFromPage.Checked) { ex.PageRange = string.Format("{0}-{1}", udFromPage.Value, udTopage.Value); } else if (optRange.Checked) { ex.PageRange = txtPagesRange.Text; } else if (optPrintCurrent.Checked) { ex.PageRange = _doc.CurrentPage.ToString(); } ex.PolyToBitmap = optPolyToBitmap.Checked; ex.StoreFonts = chkStoreFonts.Checked; ex.ToFullBitmap = optFullBitmap.Checked; ex.Viewer = txtViewerSWF.Text; string subKey = @"Software\xPDFWin\swftools\InstallPath"; var sk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(subKey); if (sk == null) { string sPath = Environment.CurrentDirectory; FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = Resources.UIStrings.TitleSelectSWFSDirs; if (dlg.ShowDialog() == DialogResult.OK) { if (!System.IO.File.Exists(dlg.SelectedPath + @"\PreLoaderTemplate.swf")) { MessageBox.Show("PreLoaderTemplate.swf not found!"); return; } else { sPath = System.IO.Path.GetDirectoryName(dlg.SelectedPath); } } var key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(subKey); key.SetValue(null, sPath); key.Close(); } else { sk.Close(); } _doc.ExportSWF(txtFileName.Text, ex); }
private void btnExport_Click(object sender, EventArgs e) { btnExport.Enabled = false; _doc.ExportSwfProgress += new PDFLibNet.ExportJpgProgressHandler(_doc_ExportSwfProgress); _doc.ExportSwfFinished += new PDFLibNet.ExportJpgFinishedHandler(_doc_ExportSwfFinished); ExportSWFParams ex = new ExportSWFParams(); ex.AddPageStop = chkAddPageStop.Checked; ex.DefaultLoaderViewer = string.IsNullOrEmpty(txtLoaderSWF.Text) && string.IsNullOrEmpty(txtViewerSWF.Text); ex.EnableLinks = chkEnableLinks.Checked; int flashVersion = 9; if (int.TryParse(cboFlashVersion.Text, out flashVersion)) ex.FlashVersion =(short)flashVersion; ex.FlattenSWF = chkFlattenSWF.Checked; ex.FontsToShapes = chkFontsToShapes.Checked; ex.IgnoreDrawOrder = chkIgnoreDrawOrder.Checked; ex.LinksColor = string.Format("{0:x}{1:x}{2:x}", colorPicker1.Color.R, colorPicker1.Color.G, colorPicker1.Color.B); ex.Loader = txtLoaderSWF.Text; ex.OpenLinksInSameWindow = !chkOpenInNewWindow.Checked; if (optFromPage.Checked) ex.PageRange = string.Format("{0}-{1}", udFromPage.Value, udTopage.Value); else if (optRange.Checked) ex.PageRange = txtPagesRange.Text; else if (optPrintCurrent.Checked) ex.PageRange = _doc.CurrentPage.ToString(); ex.PolyToBitmap = optPolyToBitmap.Checked; ex.StoreFonts = chkStoreFonts.Checked; ex.ToFullBitmap = optFullBitmap.Checked; ex.Viewer = txtViewerSWF.Text; string subKey = @"Software\xPDFWin\swftools\InstallPath"; var sk = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(subKey); if (sk == null) { string sPath = Environment.CurrentDirectory; FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.Description = Resources.UIStrings.TitleSelectSWFSDirs; if (dlg.ShowDialog() == DialogResult.OK) { if (!System.IO.File.Exists(dlg.SelectedPath + @"\PreLoaderTemplate.swf")) { MessageBox.Show("PreLoaderTemplate.swf not found!"); return; } else sPath = System.IO.Path.GetDirectoryName(dlg.SelectedPath); } var key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(subKey); key.SetValue(null, sPath); key.Close(); } else sk.Close(); _doc.ExportSWF(txtFileName.Text, ex); }
private void LoadDefaults() { ExportSWFParams ex = new ExportSWFParams(); chkAddPageStop.Checked = ex.AddPageStop; chkEnableLinks.Checked = ex.EnableLinks; chkFlattenSWF.Checked = ex.FlattenSWF; chkFontsToShapes.Checked = ex.FontsToShapes; chkIgnoreDrawOrder.Checked = ex.IgnoreDrawOrder; chkOpenInNewWindow.Checked = !ex.OpenLinksInSameWindow; chkStoreFonts.Checked = ex.StoreFonts; cboFlashVersion.Text = ex.FlashVersion.ToString(); optPolyToBitmap.Checked = ex.PolyToBitmap; optFullBitmap.Checked = ex.ToFullBitmap; txtLoaderSWF.Text = ex.Loader; txtViewerSWF.Text = ex.Viewer; }