Ok, I've already figured out how to get an image and modify it by using the code found here:
http://forum.codecal...modify-bmp.html
Now my question is can I resize that image after all modification is done? This is to make the print-out fit a smaller label. I guess what I want to do is scale it down to the printer.
Resize an Image
Started by Blaze, Sep 13 2006 05:49 AM
3 replies to this topic
#1
Posted 13 September 2006 - 05:49 AM
|
|
|
#2
Posted 22 September 2006 - 06:34 AM
I think I found your answer while searching for my answer (how to use an embedded font).
Source: http://www.ujihara.j...n/examples.html
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
using System;
using System.IO;
using com.lowagie.text;
using com.lowagie.text.pdf;
public class Chap0607
{
public static void Main(String[] args)
{
Console.WriteLine("Chapter 6 example 7: Scaling an Image");
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document, new FileStream("Chap0607.pdf", FileMode.Create));
// step 3: we open the document
document.open();
// step 4: we add content
Image jpg1 = Image.getInstance("myKids.jpg");
jpg1.scaleAbsolute(97, 101);
document.add(new Paragraph("scaleAbsolute(97, 101)"));
document.add(jpg1);
Image jpg2 = Image.getInstance("myKids.jpg");
jpg2.scalePercent(50);
document.add(new Paragraph("scalePercent(50)"));
document.add(jpg2);
Image jpg3 = Image.getInstance("myKids.jpg");
jpg3.scaleAbsolute(194, 101);
document.add(new Paragraph("scaleAbsolute(194, 101)"));
document.add(jpg3);
Image jpg4 = Image.getInstance("myKids.jpg");
jpg4.scalePercent(100, 50);
document.add(new Paragraph("scalePercent(100, 50)"));
document.add(jpg4);
// step 5: we close the document
document.close();
}
}
Source: http://www.ujihara.j...n/examples.html
#3
Posted 22 September 2006 - 02:21 PM
#4
Guest_CheeseBurgerMan_*
Posted 22 September 2006 - 03:58 PM
Guest_CheeseBurgerMan_*


Sign In
Create Account


Back to top









