[poppler] About pdf to image

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Mon Dec 19 00:52:51 PST 2011


About your original request; writing image to memory buffer,
do you need the image file header, or, the array of the pixel
data is sufficient?

If former, maybe modifying ImgWriter::init() in Goo library
to accept the pointer to pre-allocated buffer as the destination
(currently, it accepts only the file handle), then, modifying
SplashBitmap::writeImageFile() to accept the pointer to pre-allocated
buffer would be the easiest way.

If latter, SplashBitmap class is already what you want. It
has the methods to access each pixel or the pointer to whole
buffer.

Regards,
mpsuzuki

suzuki toshiya wrote:
> Hi,
> 
> Good to hear that your target platform is Ubuntu, yes, what I mean
> is the utilization of ramdisk-like filesystem. Please check the output
> of the command "cat /proc/mounts". I guess there might be some entries
> including the word "tmpfs" (maybe "/dev/shm" would be there). It is
> the files system like ramdisk, so writing/removing files in there would
> be faster than those in the harddisks. Please check if tmpfs will serve
> for your purpose.
> 
> Regards,
> mpsuzuki
> 
> 杨辉强 wrote:
>> Hi, mpsuzuki:
>>    Thank you very much. My system is ubuntu. I don't know much about 
>> memory-based file system.
>> Does it mean utility such as ramdisk.
>>
>> On 12/19/2011 12:01 PM, suzuki toshiya wrote:
>>> Hi,
>>>
>>> I guess poppler should have something you want, at least
>>> internally, because the bindings for other frameworks (Qt,
>>> GLib, cpp etc) may deal with the images without creating/
>>> cleaning temporary image files.
>>>
>>> BTW, before searching such, I want to ask an off-topic question;
>>> your target operating system does not support memory-based
>>> file system?
>>>
>>> Regards,
>>> mpsuzuki
>>>
>>> 杨辉强 wrote:
>>>> Hi, all:
>>>>   Thank Brad. I don't want to save images into files and then read 
>>>> files into memory.
>>>> The disk IO expense is high. So what's the utility from another 
>>>> application can do this job? Wish your advice.
>>>>
>>>> Thank you!
>>>>
>>>> On Sun, 18 Dec 2011 11:34:17 AM Brad Hards wrote:
>>>>
>>>> This should have gone to a mailing list.
>>>>
>>>> How are you possibly going to use the utility from another 
>>>> application and
>>>> copy to memory without making any code changes?
>>>>
>>>> Brad
>>>>
>>>>
>>>>
>>>> On 12/18/2011 08:47 AM, 杨辉强 wrote:
>>>>> Hi, all:
>>>>>    In web search engine, I want to support the pdf snapshot. So I 
>>>>> want to convert pdf files to images and save the images in a 
>>>>> database. I don't want to change the poppler code.
>>>>> Because that's notconvenient for upgrade the poppler's code.
>>>>>
>>>>> Thank you for your precious advices.
>>>>>
>>>>> On 12/17/2011 03:16 PM, Brad Hards wrote:
>>>>>> On Sat, 17 Dec 2011 02:09:21 PM 杨辉强 wrote:
>>>>>>>      I am a newbie to poppler. I use utils/pdftoppm.cc to convert 
>>>>>>> a pdf
>>>>>>> file into jpeg images.The generated images are save to disk 
>>>>>>> files. Now I
>>>>>>> wish to know whether it can save the images in memory such as a
>>>>>>> vector<std::string>.  Wishing you can give me some advices.
>>>>>> I'm sure that is possible, but you'd need to make some code 
>>>>>> changes (and
>>>>>> consider whether an arbitrary binary blob, containing nulls, is 
>>>>>> really a good
>>>>>> idea in a std::string). The code changes should basically be 
>>>>>> taking the
>>>>>> existing output writer and copying in to a memory location 
>>>>>> instead. I don't
>>>>>> see you'd need to make any real popper changes. How you integrate 
>>>>>> that depends
>>>>>> on the application you're trying to create.
>>>>>>
>>>>>> What is the end-use for this?
>>>>>>
>>>>>> Brad
>>>>>> _______________________________________________
>>>>>> poppler mailing list
>>>>>> poppler at lists.freedesktop.org
>>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> poppler mailing list
>>>>> poppler at lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> _______________________________________________
>>>> poppler mailing list
>>>> poppler at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/poppler
>>>
>>
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler



More information about the poppler mailing list