tiff

Exception when converting tiff file to pdf file with iText

大城市里の小女人 提交于 2019-12-02 00:12:02
When I try to convert a tiff file to pdf file by using itextpdf 5.5.5 , the following exception occurs: java.lang.RuntimeException: Scanline must begin with EOL code word. at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.readEOL(TIFFFaxDecoder.java:1303) at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.decode2D(TIFFFaxDecoder.java:811) at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:223) at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:315) at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:303) at com.itextpdf.text.Image.getInstance(Image

c# How to return a byte array from pdf using iTextsharp

余生颓废 提交于 2019-12-01 21:33:25
All, i created the following method to take in a tiff byte array with multiple tiff page document i need to convert this to pdf, then return a pdf byte array i have 2 problems with this code 1 - i want to RETURN a byte []. 2 - the pdf generated is repeating the pages. public void convertImage(byte[] documentContent) { Document document = new Document(PageSize.LETTER, 0, 0, 0, 0); PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(@"C:\Data\Output.pdf", FileMode.Create)); --for testing purposes Bitmap oldImage; using (var ms = new MemoryStream(documentContent)) { oldImage = new

Saving a multi frame TIFF

孤者浪人 提交于 2019-12-01 21:11:06
I load a multiframe TIFF from a Stream in my C# application, and then save it using the Image.Save method. However, this only saves the TIFF with the first frame - how can I get it to save a multiframe tiff? Yahia Since you don't provide any detailed information... just some general tips: Multi-Frame TIFF are very complex files - for example every frame can have a different encoding... a single Bitmap / Image can't hold all frames with all relevant information (like encoding and similar) of such a file, only one at a time. For loading you need to set parameter which tells the class which frame

ImageMagick: how to batch combine multiple TIFF file to a single TIFF file in a directory?

我只是一个虾纸丫 提交于 2019-12-01 21:10:27
I have 600 TIFF files in a directory, c:\temp. The file names are like: 001_1.tif, 001_2.tif, 001_3.tif 002_1.tif, 002_2.tif, 002_3.tif .... .... 200_1.tif, 200_2.tif, 200_3.tif The combined files should be placed in same directory and the files should be named like: 1_merged.tif 2_merged.tif ..... ..... 200_merged.tif I am looking for any single command-line /batch-file to do so through ImageMagick convert / mogrify command or any other command/tools. Please note the overall time taken should not be more than 5 second. Assuming you want to combine the 600 single-page TIFFs into one single

Saving a multi frame TIFF

此生再无相见时 提交于 2019-12-01 20:52:27
问题 I load a multiframe TIFF from a Stream in my C# application, and then save it using the Image.Save method. However, this only saves the TIFF with the first frame - how can I get it to save a multiframe tiff? 回答1: Since you don't provide any detailed information... just some general tips: Multi-Frame TIFF are very complex files - for example every frame can have a different encoding... a single Bitmap / Image can't hold all frames with all relevant information (like encoding and similar) of

How to load and display tiff images in TImage control?

半城伤御伤魂 提交于 2019-12-01 19:13:58
I am currently working on Delphi XE2 trial version. I want to load and display TIFF images in TImage control without using any third party component/library. I tried below code but it is not woking for me. Procedure TForm1.Button1Click(Sender: TObject); Var OleGraphic : TOleGraphic; fs : TFileStream; Source : TImage; BMP : TBitmap; Begin Try OleGraphic := TOleGraphic.Create; fs := TFileStream.Create('c:\testtiff.dat', fmOpenRead Or fmSharedenyNone); OleGraphic.LoadFromStream(fs); Source := Timage.Create(Nil); Source.Picture.Assign(OleGraphic); BMP := TBitmap.Create; bmp.Width := Source.Picture

WPF Image control to progressively load multipage tiff

99封情书 提交于 2019-12-01 18:57:50
I'm wondering if there's an existing control or if it would be straightforward to develop a control allowing a multipage tiff to be progressively loaded over a network? I'm working with some tiff images that are up to thousands of pages, and it would be great to have the image start to appear as soon as a page or pages are downloaded, and only retrieve additional pages of the image as needed, or download on demand or when bandwidth is available. I realise that a TIFF image has certain structural requirements and surrounding metadata, but expect that this should be possible. Adriaan I suggest

Add a file association with tiff files on iOS

泄露秘密 提交于 2019-12-01 18:50:00
I'd like to create a file associate with tiff files in my iOS app (i.e. so that my app appears as a target for opening tiff files from Mail or Safari). Adding the following to my Info.plist file doesn't seem to work: <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>tiff</string> <key>LSItemContentTypes</key> <array> <string>public.tiff</string> </array> <key>LSHandlerRank</key> <string>Alternate</string> </dict> </array> I have an app that I associate with PDFs in the same way and it works fine. I believe that it is not possible to associate an app with the

Save raw data as tif

試著忘記壹切 提交于 2019-12-01 18:36:45
I need to analyze a part of an image, selected as a submatrix, in a tif file. I would like to have the image in raw format, with no frills (scaling, axis, labels and so on)... How could I do that? This is the code I am using now: submatrix = im[x_min:x_max, y_min:y_max] plt.imshow(submatrix) plt.savefig("subplot_%03i_%03i.tif" % (index, peak_number), format = "tif") First off, if you're just wanting to store the raw values or a grayscale representation of the raw values, it's easiest to just use PIL for this. For example, this will generate a 10x10 grayscale tif file: import numpy as np import

To load .tiff file in C#

给你一囗甜甜゛ 提交于 2019-12-01 17:31:27
I have to load .tiff file I did with both Image.FromFile() and Bitmap.FromFile() But they are throwing OutOfMemoryException Any solution for how to load this? Stefan Egli I assume that the TIFF file you are trying to load uses a compression that is not compatible with .Net. Namely the JPEG compression is not supported by .Net. I suggest you try LibTiff.Net (though I cannot tell for sure if it will work): Kimtho6 I use ImageGlue . It can convert a lot more then just tiff. There is a project on codeproject : "How to Load/Display images with C#". Take a look at it There is a possibility that this