void ePDFRefrescar(object sender, System.EventArgs e) { List <object> info = new List <object>(); info.Add(this._tituloForm); if (this.twNavegador.SelectedNode.Tag is PlantaEdificio) { info.Add((this.twNavegador.SelectedNode.Tag as PlantaEdificio).Edificio); info.Add((this.twNavegador.SelectedNode.Tag as PlantaEdificio)); } if (this.twNavegador.SelectedNode.Tag is Estancia) { info.Add((this.twNavegador.SelectedNode.Tag as Estancia).PlantaEdificio.Edificio); info.Add((this.twNavegador.SelectedNode.Tag as Estancia).PlantaEdificio); } if (this.twNavegador.SelectedNode.Tag is Ubicacion) { info.Add((this.twNavegador.SelectedNode.Tag as Ubicacion).Estancia.PlantaEdificio.Edificio); info.Add((this.twNavegador.SelectedNode.Tag as Ubicacion).Estancia.PlantaEdificio); } LayoutHelper.RunTimeTemplates plantilla = LayoutHelper.RunTimeTemplates.BuiltInDINA4PortraitLayout; BoundingBox rect = this.Mapa.GetExtents(); if (rect.Width > rect.Height) { plantilla = LayoutHelper.RunTimeTemplates.BuiltInDINA4LandscapeLayout; } this.MapaPDF = new PDFMap(this.Mapa, info, plantilla); this.Preview.PageSize = PdfSharp.PageSizeConverter.ToSize(this.MapaPDF.Layout.Size); if (rect.Width > rect.Height) { //Cambiamos a orientaciĆ³n apaisada System.Drawing.Size landscapeSize = new System.Drawing.Size(this.Preview.PageSize.Height, this.Preview.PageSize.Width); this.Preview.PageSize = landscapeSize; } this.Preview.SetRenderEvent(MapaPDF.Render); this.tsbPDFGuardar.Enabled = true; this.tsbPDFImprimir.Enabled = true; }
public PDFMap(Map map, List <object> bindObjects, LayoutHelper.RunTimeTemplates template) { _BindObjs = bindObjects; _Map = map; _layout = LayoutHelper.GetDefaultLayout(template); }
public void ChangeLayout(LayoutHelper.RunTimeTemplates template) { _layout = LayoutHelper.GetDefaultLayout(template); }