Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

pdf size using itextsharp

Posted on 2012-03-17
5
Medium Priority
?
1,495 Views
Last Modified: 2012-03-21
hi
This is really the question,
How can we get the exact obsolete image size of the image, because when I extracted the image from the pdf file, the image was huge(1295x620),  but in viewing the pdf using any pdf reader, the image is small(a small RED box at the center)

small image in pdf page
How can I get that small size?
0
Comment
Question by:systan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 37733789
0
 
LVL 14

Author Comment

by:systan
ID: 37734030
it says:
jpg2.Height * my_scalefactor

Open in new window


where can i get my_scalefactor?
if (pic.Height > pic.Width)
    {
        //Maximum height is 800 pixels.
        float percentage = 0.0f;
        percentage = 700 / pic.Height;
        pic.ScalePercent(percentage * 100);
    }
    else
    {
        //Maximum width is 600 pixels.
        float percentage = 0.0f;
        percentage = 540 / pic.Width;
        pic.ScalePercent(percentage * 100);
    }

    pic.Border = iTextSharp.text.Rectangle.BOX;
    pic.BorderColor = iTextSharp.text.BaseColor.BLACK;
    pic.BorderWidth = 3f;

//BUT this CODE is for adding image to PDF file
    document.Add(pic);
    document.NewPage();

Open in new window

//BUT that CODE is for adding image to PDF file

I'm Extracting the image, if the image is small in the preview, then when extracted it will have the same size.

I hope you understand my grammar, sorry for that.

I'll try to see this link: (also adding image in PDF)
http://fahadzia.com/blog/2010/06/itextsharp-image-resize/

thank you
0
 
LVL 14

Author Comment

by:systan
ID: 37741420
Should the question is:
How to get the image position from left?
If I can get the image position left, then I can get the image position right and top to bottom.

then it might be
right - left = the image crop width
then
bottom - top = the image crop height

But how to get it? since there is no left or right properties in itextsharp.text.image
0
 
LVL 14

Author Comment

by:systan
ID: 37743849
hi
is that possible?
0
 
LVL 14

Author Closing Comment

by:systan
ID: 37750062
I found the links, thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question