private void btSetting_Click(object sender, EventArgs e) { if (listView1.SelectedIndices.Count > 0) { int index = 0; ListViewItem lvItem; foreach (ListViewItem lm in listView1.SelectedItems) { DWFPageData pageData = pdCollection[lm.Index]; publishSetting pSet = new publishSetting(pageData, fileName); if (DialogResult.OK == pSet.ShowDialog()) { index = lm.Index; pdCollection[index] = pageData; lvItem = new ListViewItem(pageData.Layout); lvItem.SubItems.Add(pageData.PageTitle); lvItem.SubItems.Add(fileName); lvItem.SubItems.Add(pageData.PageAuthor); lvItem.SubItems.Add(pageData.PageSubject); lvItem.SubItems.Add(pageData.Preview.FileName); lvItem.SubItems.Add(pageData.PageComments); listView1.Items.RemoveAt(index); listView1.Items.Insert(index, lvItem); Update(); } } } }
public publishSetting(DWFPageData pd, String drawing) { pageData = pd; InitializeComponent(); textBoxLayoutName.Text = pageData.Layout; textBoxSheetName.Text = pageData.PageTitle; textBoxDrawingName.Text = drawing; textBoxSubject.Text = pageData.PageSubject; textBoxCompany.Text = pageData.PageCompany; textBoxCom.Text = pageData.PageComments; textBoxAuthor.Text = pageData.PageAuthor; textBoxFilename.Text = pageData.Preview.FileName; textBoxWidth.Text = pageData.Preview.Width.ToString(); textBoxHeight.Text = pageData.Preview.Height.ToString(); textBoxColorDepth.Text = pageData.Preview.ColorDepth.ToString(); }
void InitPagaDate() { String strSeed = param.Database.Filename; int first = strSeed.LastIndexOf("\\") + 1; int last = strSeed.LastIndexOf("."); strSeed = strSeed.Substring(first, last - first); ObjectId idBlockModelSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(param.Database); ObjectId idLayout; using (BlockTableRecord objBlockModelSpaceId = (BlockTableRecord)idBlockModelSpaceId.GetObject(OpenMode.ForRead)) { idLayout = objBlockModelSpaceId.LayoutId; using (Layout objLayout = (Layout)idLayout.GetObject(OpenMode.ForRead)) { DWFPageData pageData = new DWFPageData(); pageData.Layout = objLayout.LayoutName; // init default sheet name pageData.PageTitle = strSeed + '-' + pageData.Layout; pdCollection.Add(pageData); } } // To get the access paper layouts in this database. using (DBDictionary layouts = (DBDictionary)param.Database.LayoutDictionaryId.GetObject(OpenMode.ForRead)) { foreach (DBDictionaryEntry entry in layouts) { if (entry.Value == idLayout) { continue; } DWFPageData pageData = new DWFPageData(); pageData.Layout = entry.Key; pageData.PageTitle = strSeed + '-' + entry.Key; pdCollection.Add(pageData); } } }
public static void DWF_export(Database database, Teigha.GraphicsSystem.LayoutHelperDevice helperDevice) { SaveFileDialog sfd = new SaveFileDialog(); sfd.AddExtension = true; sfd.DefaultExt = "dwf"; sfd.Title = "Export To Dwf"; sfd.Filter = String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", "Binary DWF (Desgin Web Format) v6.0 (*.dwf)|*.dwf", "Zipped Ascii Encoded 2D Stream DWF (Design Web Format) v6.0 (*.dwf)|*.dwf", "Compressed DWF (Design Web Format) v5.5 (*.dwf)|*.dwf", "Binary DWF (Design Web Format) v5.5 (*.dwf)|*.dwf", "Ascii DWF (Design Web Format) v5.5 (*.dwf)|*.dwf", "Compressed DWF (Design Web Format) v4.2 (*.dwf)|*.dwf", "Binary DWF (Design Web Format) v4.2 (*.dwf)|*.dwf", "Ascii DWF (Design Web Format) v4.2 (*.dwf)|*.dwf"); if (sfd.ShowDialog() == DialogResult.OK) { String strFileName = sfd.FileName; using (mDwfExportParams param = new mDwfExportParams()) { param.Database = database; param.FileName = strFileName; param.BackgroundColor = helperDevice.BackgroundColor; param.InkedArea = false; param.ColorMapOptimize = false; param.ExportInvisibleText = true; DwfPageDataCollection pageDataColl = new DwfPageDataCollection(); DWFPageData pageData; switch (sfd.FilterIndex) { case 1: param.Format = DwfFormat.UNCOMPRESSED_BINARY; param.Version = DwfVersion.Dwf_v60; pageData = new DWFPageData(); pageData.Layout = LayoutManager.Current.CurrentLayout; pageDataColl.Add(pageData); param.PageData = pageDataColl; break; case 2: param.Format = DwfFormat.ASCII; param.Version = DwfVersion.Dwf_v60; pageData = new DWFPageData(); pageData.Layout = LayoutManager.Current.CurrentLayout; pageDataColl.Add(pageData); param.PageData = pageDataColl; break; case 3: param.Format = DwfFormat.COMPRESSED_BINARY; param.Version = DwfVersion.Dwf_v55; break; case 4: param.Format = DwfFormat.UNCOMPRESSED_BINARY; param.Version = DwfVersion.Dwf_v55; break; case 5: param.Format = DwfFormat.ASCII; param.Version = DwfVersion.Dwf_v55; break; case 6: param.Format = DwfFormat.COMPRESSED_BINARY; param.Version = DwfVersion.Dwf_v42; break; case 7: param.Format = DwfFormat.UNCOMPRESSED_BINARY; param.Version = DwfVersion.Dwf_v42; break; case 8: param.Format = DwfFormat.ASCII; param.Version = DwfVersion.Dwf_v42; break; default: return; } Export_Import.ExportDwf(param); } } }