I want to convert 2 images into a single pdf file.One image is big in size and small image on the top of the big image.
So In generated pdf also I need to show the small image on the top of the big image and also in the same position where it is in case of image.
I use pdfSharp to convert image to pdf.It will convert the images into pdf file but not able to position the second image on the top of the first image.
Can any one help me on that.Thanks in advance.
Check out the sample below and see if it's what you need:
http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=34&Itemid=45
Related
I have a PDF that is a template I will use to print onto special paper stock in a printer. I want to create a way to use the mouse to capture x,y locations when i click on certain areas of the pdf. The pdf template is based on an 8 1/2 x 11 piece of paper.
One of my ideas was to convert the page in the pdf to a jpg and load it into a picturebox using c# and a windows forms application. Then I can capture the x,y when i click the mouse but I'm not sure how that will translate to the pdf.
I'm open to opensource suggestions but I also have both the Aspose Words and Aspose PDF products. I'd also prefer a .NET solution.
Rather than storing a direct X/Y pixel co-ordinate then, you could store them as a % of the page.
So go down your jpeg idea, get the pixel X,Y of your location, then divide those by the Width,Height of the Jpeg to give you X%,Y%
When you come to do your printing, get the paper size and multiply that by your X%,Y% to get your offset within the print document
In the end what worked for me was finding out that 1 inch = 72 points. So as far as the Aspose library was concerned that conversion factor worked for me. THEN I created a jpeg that was 1 pixel by 1 pixel and would stamp that on the PDF using the XIndent and the YIndent. This allowed me to stamp a pixel in the upper left corner of pdf and then using the width and height of the page and the conversion factor I was able to deduce the other 3 corners!
I'm hitting brick walls trying to see if this is possible.
My current scenario is that we have a process (out of our control) that generates PDFs with an image logo in the top left. The image resolution is very low and looks bad. I'm trying to replace it with a vector based version of the logo and I can't seem to figure out how to do this using iTextSharp. I know that I could insert a higher resolution image, but I want a graphic/vector drawing to be there instead (scales with zoom, for the challenge, etc.)
I've tried to figure out if I can copy the PDF draw operands + content for the graphic into a new PDF but this doesn't seem easily doable.
Is there a way to just insert an SVG at a specific position and size using iTextSharp? Or some other way I can insert this vector graphic?
I need to extract text from a pdf document and I am using the iTextSharp library to do so. The issue is that the image has text on it which is not part of the image. I have been looking to find a way to get the coordinates of the image as there are annotations on the image being included in the text extraction:
e.g.
Results in the extraction:
Some text...
Text
Text
More Text..
However, the text in the image is irrelevant and needs to be ignored to give the output:
Some text...
More text...
Another issue is that there are multiple pages with this issue with images all being different sizes, however, all the text is always within the image bounds which is why if I have a way of determining the height and x, y coordinates of the image relative to the page I can extract the necessary data.
Currently, I need to just get the text but I will also need to extract the images at a later date.
I need to crop an image such that it contains only text, no blank area..
eg. below..
Like this image contains a lot of space on all the four sides
and this one is the cropped version of the image.
is there something (library) that can automate this process.
I'm using VTK API in my C# application. Please can someone explain how to convert my image series which is in .jpeg format to .vti image file to be able to use it in my application? The image series contains sequential abdomen images. Quick reply will be most appropriated. Thanks in advance!
You can read each image in the series using:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/JPEGReader
Then, you could combine them into a 3D image manually:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/IterateImageData
Or more automatically with:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/CombiningRGBChannels