TIFF File viewer like PDF.JS

0
0

Does anyone know of a multi-page TIFF file viewer that is like PDF.JS that will work with WiseJ?

Need to add TIFF file viewing to an application.

  • You must to post comments
0
0

Actually you can use the PictureBox as-is for multi page tiff, just override OnPaint in your derived class like this:

protected override void OnPaint(PaintEventArgs e)
{
    this.Image.SelectActiveFrame(FrameDimension.Page, pageIndex);
    base.OnPaint(e);
}

Now you can assign the Image property of pictureBox1.Image = Image.FromFile(“multi page tiff”).

Managing pageIndex and the page count is up to your class.

  • You must to post comments
0
0

There isn’t any decent javascript tiff viewer around. But Wisej already supports viewing tiff in the PictureBox control. The best way to view a tiff is to draw it into an image. And all Wisej controls support the Paint event. The PictureBox already recognizes a tiff file and will convert it to a png and display it in the PictureBox using all the different SizeMode options.

But it doesn’t support the multi pages as a built-in functionality. However, it’s easy to add. You can create a derived PictureBox class, say TiffViewer.  Attach to the Paint event. In the paint event use:

var g = e.Graphics;

g.DrawImage(image, ... arguments depends on scaling);

 

Load the image object from the tiff file using Image.FromFile().

To read the number of pages in the tiff use:

var pageCount = image.GetFrameCount(FrameDimension.Page);

To display a specific page use this before g.DrawImage(image).

image.SelectActiveFrame(FrameDimension.Page, pageIndex);

HTH

 

 

 

 

 

  • edmond girardi
    This option seems like all the image processing will happen at the server, correct ? Although that would work in certain scenarios i think in our case it would strain the server. We have hundreds of users potentially viewing these files. Currently the PDFs using pdf.js are rendered at the browser – so our system only delivers the file to the client.
  • Luca (ITG)
    It’s like downloading an image. The workload for the OS to draw a tiff is negligible.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.