PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Draw Image
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1544
Page 1 of 1

Author:  RoyT [ Fri Feb 11, 2011 1:19 pm ]
Post subject:  Draw Image

Hi

I am having some issues with the pdfsharp graphics.drawimage command.

I have a barcode component that generates a Windows Metafile format image.

I tried using it with PDFSharp and got a "Format not supported" error.

So I added the following lines of code to get around it:

Dim ABCBarcode As New AbcnetLib.Abcnet
ABCBarcode.Caption = CStr(mdstPrintDetails.Tables(0).Rows(mintRowPoint).Item("BARCODE1"))
ABCBarcode.SerialNo = "6LDR1Q4QVZS2C??"
ABCBarcode.CodeType = AbcnetLib.Abcnet.bCode.Code_128
Dim picPicture As New PictureBox
picPicture.SizeMode = PictureBoxSizeMode.Zoom

picPicture.Image = Bitmap.FromStream(ABCBarcode.sBarcode(600, 600, System.Drawing.Imaging.ImageFormat.Bmp, 1))

(ABCBarcode.sBarcode(int hDpi, int vDpi) generates an image scaled to be suitable for printing on a device with horizontal and vertical resolutions of hDpi and vDpi dots per inch respectively. )



This works fine as long as there are not too many pages in the document I am trying to generate. But whenever my document gets above approx 25 pages I start getting some very strange errors e.g. Unspecified GDI+ error or "Parameter is missing"

The exact same code copes with up to 20 pages perfectly (although it is quite slow to run)

Any assistance gratefully accepted!

Roy

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/