I now am trying to use System.Drawing in iTextSharp PDF creator.
I have successfully downloaded iTextSharp.dll from SourceForge, placed it in a folder in my ASP.net project and "Add Reference" browse to my solution.
It works fine.
I am having some trouble turning my MemoryStream, ms, into an iTextSharp jpg image as seen below:
Dim doc As New Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35)
Dim output = New MemoryStream()
Dim writer = PdfWriter.GetInstance(doc, output)
doc.Open()
Using xPanel As New Bitmap(500, 500)
Using gphs As Graphics = Graphics.FromImage(xPanel)
Dim ms As New MemoryStream()
...System.Drawing Code...
xPanel.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim image As System.Drawing.Image = System.Drawing.Image.FromStream(ms)
Dim PdfImage As iTextSharp.text.Image = iTextSharp.text.Image.GetInstance(image, System.Drawing.Imaging.ImageFormat.Jpeg)
doc.Add(PdfImage)
End Using
End Using
doc.Close
...
Participant
953 Points
785 Posts
MemoryStream into an iTextSharp jpg image
Jul 19, 2016 10:33 PM|Philosophaie|LINK
I now am trying to use System.Drawing in iTextSharp PDF creator.
I have successfully downloaded iTextSharp.dll from SourceForge, placed it in a folder in my ASP.net project and "Add Reference" browse to my solution.
It works fine.
I am having some trouble turning my MemoryStream, ms, into an iTextSharp jpg image as seen below:
All-Star
194524 Points
28081 Posts
Moderator
Re: MemoryStream into an iTextSharp jpg image
Jul 20, 2016 06:49 AM|Mikesdotnetting|LINK
Participant
953 Points
785 Posts
Re: MemoryStream into an iTextSharp jpg image
Jul 20, 2016 10:49 AM|Philosophaie|LINK
Nothing happens. The System.Drawing code that I entered was not executed. No error messages.