/// <summary> /// Renderiza o bloco para um XObject. /// </summary> public virtual org.pdfclown.documents.contents.xObjects.XObject ToXObject() { if (_RenderedObject == null) { _RenderedObject = new org.pdfclown.documents.contents.xObjects.FormXObject(Danfe.Document, Size); org.pdfclown.documents.contents.composition.PrimitiveComposer composer = new org.pdfclown.documents.contents.composition.PrimitiveComposer(_RenderedObject); var obj = composer.BeginLocalState(); composer.SetLineWidth(DanfeDocumento.LineWidth); if (PossuiCabecalho) { RectangleF rect = GetHeaderInnerRectangle(); //Danfe.PrintCabecalhoBloco2(composer, rect.Top, rect.Left, rect.Width, Cabecalho); PrintCabecalho(composer); } ToXObjectInternal(composer); foreach (var campo in Campos) { campo.Print(composer, Danfe.Font, Danfe.FontBold); } composer.Stroke(); composer.End(); composer.Flush(); } return(_RenderedObject); }
public org.pdfclown.documents.contents.xObjects.XObject ToXObject(org.pdfclown.documents.Document context) { var xObject = new org.pdfclown.documents.contents.xObjects.FormXObject(context, Size); org.pdfclown.documents.contents.composition.PrimitiveComposer composer = new org.pdfclown.documents.contents.composition.PrimitiveComposer(xObject); this.ToInlineObject(composer); composer.Flush(); return(xObject); }
/// <summary> /// Imprime o cabeçalho do bloco. /// </summary> private void PrintCabecalho(org.pdfclown.documents.contents.composition.PrimitiveComposer comp) { org.pdfclown.documents.contents.composition.BlockComposer bComp = new org.pdfclown.documents.contents.composition.BlockComposer(comp); RectangleF rect = new RectangleF(0, 0, Size.Width, Danfe.CabecalhoBlocoAltura); rect = rect.GetPaddedRectangleMm(0, 0, 1, 0.3F); comp.SetFont(Danfe.FontBold, 5); bComp.SafeBegin(rect, org.pdfclown.documents.contents.composition.XAlignmentEnum.Left, org.pdfclown.documents.contents.composition.YAlignmentEnum.Bottom); bComp.ShowText(Cabecalho.ToUpper()); bComp.End(); comp.Flush(); }
public void Renderizar(int pagina, int nPaginas) { PosicionarBlocos(); foreach (var bloco in BlocosSuperiores.Union(BlocosInferiores)) { _Composer.ShowXObject(bloco.ToXObject(), bloco.Posicao); } PrintNumeroFolhas(pagina, nPaginas); if (_Danfe.Model.TipoAmbiente != 1) { PrintMarcaDAgua("SEM VALOR FISCAL"); } PrintCreditos(); _Composer.Flush(); }