Hello, I'd like a help please regarding a problem I'm having to insert an image into my console application project. I can only use the absolute path when I send the project the client will have to change how do I do that does not have to happen?
Private Function cabecalhoPolicardPDF() As PdfPTable
Try
Dim img = iTextSharp.text.Image.GetInstance("G:\projetolimpo\up_sgp-master\RotinaRelacaoLimiteComplementar\img\logo-sombra.jpg")
Dim table = New PdfPTable(2)
table.HorizontalAlignment = Element.ALIGN_LEFT
table.TotalWidth = 500
Dim widths() As Integer = {190, 310}
table.SetWidths(widths)
Dim cell As New PdfPCell(img)
cell.Border = 0
cell.HorizontalAlignment = Element.ALIGN_RIGHT
cell.VerticalAlignment = Element.ALIGN_MIDDLE
Dim cell2 As New PdfPCell()
Dim VerdanaCab As iTextSharp.text.Font = FontFactory.GetFont("Verdana", 13, iTextSharp.text.Font.BOLD)
VerdanaCab.SetColor(245, 145, 0)
Dim Verdana As iTextSharp.text.Font = FontFactory.GetFont("Verdana", 9, iTextSharp.text.Font.BOLD)
Dim VerdanaN As iTextSharp.text.Font = FontFactory.GetFont("Verdana", 9, iTextSharp.text.Font.NORMAL)
Dim p0 As New Phrase()
Dim c1 As New Chunk("SISTEMA UP BRASIL" & Environment.NewLine & Environment.NewLine, VerdanaCab)
p0.Add(c1)
p0.Leading = 50
cell2.AddElement(p0)
cell2.SetLeading(0.0F, 0.0F)
c1 = New Chunk("Razão Social: ", Verdana)
Dim c2 As New Chunk("Policard Systems e Serviços S/A" & Environment.NewLine, VerdanaN)
Dim p1 As New Phrase()
p1.Leading = 10
p1.Add(c1)
p1.Add(c2)
cell2.AddElement(p1)
cell2.Border = 0
cell2.HorizontalAlignment = Element.ALIGN_LEFT
table.AddCell(cell2)
table.AddCell(cell)
table.HorizontalAlignment = Element.ALIGN_LEFT
Return table
Catch ex As Exception
Throw ex
End Try
End Function