pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thad Humphries <thad.humphr...@gmail.com>
Subject Question about CCITTFactory
Date Sat, 18 Feb 2017 16:15:51 GMT
I am processing images, mostly TIFF Group 4, from a repository, and
outputting them as PDF. The images *always* come to me in a byte array,
never as a file. In fact, I've no option to get it as a file. The
repository may or may not be local--it's accessed through its own API.

I would like to convert this buffer directly to a PDImageXObject, but both
the CCITTFactory.createFromRandomAccess() are deprecated. Why? Looking at
the source for the CCITTFactory class, they do the same thing as the
createFromFile() methods, which first create a RandomAccessFile before
calling createFromRandomAccessImpl().

Outside of this project, I've tried CCITTFactory.createFromFile() and seen
that it is significantly faster than creating a BufferedImage and calling
CCITTFactory.createFromImage(). Possibly it's fast enough to take the hit
of writing the TIFF byte array to a temporary file, but why take the hit?

So, why are CCITTFactory.createFromRandomAccess() are deprecated?

-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message