{oapdf_gg}
Office software is closely linked to the PDF,the PDF is also must have to control!      Set home Page  Add to Favorites  
You are here:Home > PDF Application > PDF Development
PDF Development
Using C# language the whole PDF document Strategy Guide Graphic
Finishing by: Date:2009-04-17 20:59:48 Popularity: Tags:

Syste m . Drawing.Bitmap

sample code 0610 is a more advanced topic for the following reasons:

  1. used for the first time to System.Drawing.Bitmap category. In such. Net framework, you can use more types of images, such as TIFF, GIF, and these images do not support in iText, you can check. Net framework you need to take a look at the picture format is supported.
  2. previous example, there are still some things to note:When adding a picture will not be any problems, word has always been floating in the picture above, in this case, we hope that picture floating in the text above. That is why we will use category iTextSharp.text.pdf.PdfContentByte reasons (see Chapter X).
  3. you will find pictures to use for transparent gif format, you can go to /upfile/2009417/2009417205947821 . gif download.

TIFF and CCITT

sample code 0611 is a more advanced topic, for example, a TIFF file converted to PDF documents.

u picture mask

sample code in 0613, we have created a mask for the image

 

 

 

 

 

 

 

 

 

3C

 

 

 

 

 

 

 

 

7E

 

 

 

 

 

 

 

 

E7

 

 

 

 

 

 

 

 

C3

 

 

 

 

 

 

 

 

C3

 

 

 

 

 

 

 

 

E7

 

 

 

 

 

 

 

 

7E

 

 

 

 

 

 

 

 

3C

 

 

 

 

 

 

 

 

 

the picture size is 8 กม 8 pixels, each one byte, the use of makeMask () method can be converted into a mask.

byte maskr [] = ((byte) 0x3c, (byte) 0x7e, (byte) 0xe7, (byte) 0xc3, (byte) 0xc3, (byte) 0xe7, (byte) 0x7e, (byte) 0x3c);

Image mask = Image.getInstance (8, 8, 1, 1, maskr);

mask.makeMask ();

mask.setInvertMask (true);

we can directly use the mask to cover part of the other pictures.

PdfContentByte cb = writer.DirectContent;

Image image = Image.getInstance ( "vonnegut.gif ");

image.ImageMask = mask;

We

the mask or cover up the crime for the template.

PdfContentByte cb = writer.DirectContent;

cb.setRGBColorFill (255, 0, 0);

cb.addImage (mask, mask.scaledWidth () * 8, 0, 0, mask.scaledHeight () * 8, 100, 400);

more information on the object ContentByte see chap.

pictures and other objects

u picture in block

Sometimes, pictures can be easily placed in block by a certain offset of a picture placed in block:

Chunk ck = new Chunk (img, 0, -5);

specific code, see sample code 0614, we can add a special picture of the block to the phrase, tables and so on, the picture in this case go to /upfile/2009417/2009417205948162.png to download.

u picture in the table

you can add pictures to the cell, but there are two side effects:

l is to determine the width of the table, when the picture beyond the width of the cell, it will be automatically narrowed.

You can not

l wrapping text and add an underscore for the picture.

see the sample code 0615.

Notes

u picture link

If you want a clickable image, or would like to add a link to the picture on the Notes, you need to create a Annotation object, and add to the picture, you do not need to specify the location (you can use 0,0,0, 0), the location will be updated to fit within the picture.

gif.Annotation = new Annotation (0, 0, 0, 0, "Chap1102b.pdf", 3);

jpeg.Annotation = new Annotation ( "picture", "These are my children", 0, 0, 0, 0);

sample code to participate in 0616.

there isArticle InformationsComment Information
Category column

Site Help | Site Map | Feedback |
OAPDF.COM Copyright 2009 V1.1