6 Console.WriteLine("libhpdf-" + HPdfDoc.HPdfGetVersion())
8 Dim raw_image_data() As Byte = { _
9 &HFF, &HFF, &HFF, &HFE, &HFF, &HFF, &HFF, &HFC, _
10 &HFF, &HFF, &HFF, &HF8, &HFF, &HFF, &HFF, &HF0, _
11 &HF3, &HF3, &HFF, &HE0, &HF3, &HF3, &HFF, &HC0, _
12 &HF3, &HF3, &HFF, &H80, &HF3, &H33, &HFF, &H0, _
13 &HF3, &H33, &HFE, &H0, &HF3, &H33, &HFC, &H0, _
14 &HF8, &H7, &HF8, &H0, &HF8, &H7, &HF0, &H0, _
15 &HFC, &HCF, &HE0, &H0, &HFC, &HCF, &HC0, &H0, _
16 &HFF, &HFF, &H80, &H0, &HFF, &HFF, &H0, &H0, _
17 &HFF, &HFE, &H0, &H0, &HFF, &HFC, &H0, &H0, _
18 &HFF, &HF8, &HF, &HE0, &HFF, &HF0, &HF, &HE0, _
19 &HFF, &HE0, &HC, &H30, &HFF, &HC0, &HC, &H30, _
20 &HFF, &H80, &HF, &HE0, &HFF, &H0, &HF, &HE0, _
21 &HFE, &H0, &HC, &H30, &HFC, &H0, &HC, &H30, _
22 &HF8, &H0, &HF, &HE0, &HF0, &H0, &HF, &HE0, _
23 &HE0, &H0, &H0, &H0, &HC0, &H0, &H0, &H0, _
24 &H80, &H0, &H0, &H0, &H0, &H0, &H0, &H0 _
28 Dim pdf As HPdfDoc = New HPdfDoc()
30 pdf.SetCompressionMode(HPdfDoc.HPDF_COMP_ALL)
33 Dim font As HPdfFont = pdf.GetFont("Helvetica", Nothing)
35 ' add a new page object.
36 Dim page As HPdfPage = pdf.AddPage()
42 page.SetFontAndSize(font, 20)
43 page.MoveTextPos(220, page.GetHeight() - 70)
44 page.ShowText("RawImageDemo")
47 ' load RGB raw-image file.
48 Dim image As HPdfImage = pdf.LoadRawImageFromFile("demo\\rawimage\\32_32_rgb.dat", 32, 32, HPdfColorSpace.HPDF_CS_DEVICE_RGB)
53 ' Draw image to the canvas. (normal-mode with actual size.)
54 page.DrawImage(image, x, y, 32, 32)
56 ' load GrayScale raw-image file.
57 image = pdf.LoadRawImageFromFile("demo\\rawimage\\32_32_gray.dat", 32, 32, HPdfColorSpace.HPDF_CS_DEVICE_GRAY)
62 ' Draw image to the canvas. (normal-mode with actual size.)
63 page.DrawImage(image, x, y, 32, 32)
65 ' load GrayScale raw-image (1bit) file from memory.
66 image = pdf.LoadRawImageFromMem(raw_image_data, 32, 32, HPdfColorSpace.HPDF_CS_DEVICE_GRAY, 1)
71 ' Draw image to the canvas. (normal-mode with actual size.)
72 page.DrawImage(image, x, y, 32, 32)
74 ' save the document to a file
75 pdf.SaveToFile("RawImageDemo.pdf")
78 Console.Error.WriteLine(ex.Message)