1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$carga = [System.Reflection.Assembly]::LoadFrom("C:\Users\juan\itext\itextsharp.dll") $document = [iTextSharp.text.Document]::new() $stream = [IO.File]::OpenWrite("C:\Users\juan\itext\output.pdf") $writer = ([iTextSharp.text.pdf.PdfWriter]::GetInstance($document, $stream)) $document.Open() $dc = $writer.DirectContent # Línea al principio del documento $dc.MoveTo(0, $document.PageSize.Height-1) $dc.LineTo($document.PageSize.Width, $document.PageSize.Height-1) $dc.Stroke() # Resto de líneas hasta el final del documento $dc.SetCMYKColorStroke(0, 255, 255, 0) 0..($document.PageSize.Height) | %{ $dc.MoveTo(0, $document.PageSize.Height-($_*15)) $dc.LineTo($document.PageSize.Width, $document.PageSize.Height-($_*15)) $dc.Stroke() } $document.Close() $stream.Close() |