You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Eliot Kimber <ek...@rsicms.com> on 2012/12/06 18:48:45 UTC
Handling Graphics from Scanned PDF
I am trying to find QR codes on PDFs that are scanned page images. My code
works fine for scans produced by my OfficeJet and for page images produced
out of Acrobat but scans produced by my client's eCopy ShareScan device
(according to the PDF metadata) are not usable.
Looking into the PDF data stream, each page is represented by two images, a
"bg" image that is what I would expect for the page image, but very faint
grey, and a "fg" image that reflects the page content but with lots of grey
and ghosting.
The PDF renderer must be combining these two images in some way to provide
the clear image I see in Acrobat.
Is there something I can find in the PDF data stream that will tell me how
these images are combined and, if so, can anyone point me in the right
direction for processing these images? I am pretty new to Java image
processing so I'm not sure where to look or what to look for.
The images themselves are repored by PDFBox as PDJpeg objects.
I can provide a sample PDF page if it's needed.
Thanks,
Eliot
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
Was able to use the Maven command line to build the jar: mvn clean install
Cheers,
E.
On 12/10/12 8:43 AM, "Eliot Kimber" <ek...@rsicms.com> wrote:
> Unfortunately, I have no experience with Maven and after installed the m2e
> Eclipse plugin, didn't see an obvious way to do whatever needs doing. Is
> there documentation for this somewhere?
>
> Thanks,
>
> Eliot
>
> On 12/9/12 11:02 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
>
>> Hi,
>>
>> Am 09.12.2012 16:45, schrieb Eliot Kimber:
>>> At least using the 1.7.1 release, the combined image is not usable--it
>>> doesn't reflect the application of the mask (at least I think that's what's
>>> happening).
>> I've run some test and the most recent trunk works.
>>
>>> I'm not sure how to build the pdfbox-app jar, which is what my application
>>> uses. I have successfully built the pdfbox.jar from the latest source but I
>>> didn't see anything in the build.xml for producing the pdfbox-app.jar.
>> Starting with PDFBox 1.0.0 the default build system is based on Maven [1].
>> The
>> build.xml still remains because of some historical reasons.
>>
>>> Thanks,
>>>
>>> Eliot
>>>
>>>
>>> SNIP
>>
>> BR
>> Andreas Lehmkühler
>> [1] http://pdfbox.apache.org/userguide/building_pdfbox.html
>
> --
> Eliot Kimber
> Senior Solutions Architect, RSI Content Solutions
> "Bringing Strategy, Content, and Technology Together"
> Main: 512.554.9368
> www.rsicms.com
> www.rsuitecms.com
> Book: DITA For Practitioners, from XML Press,
> http://xmlpress.net/publications/dita/practitioners-1/
>
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
Unfortunately, I have no experience with Maven and after installed the m2e
Eclipse plugin, didn't see an obvious way to do whatever needs doing. Is
there documentation for this somewhere?
Thanks,
Eliot
On 12/9/12 11:02 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
> Hi,
>
> Am 09.12.2012 16:45, schrieb Eliot Kimber:
>> At least using the 1.7.1 release, the combined image is not usable--it
>> doesn't reflect the application of the mask (at least I think that's what's
>> happening).
> I've run some test and the most recent trunk works.
>
>> I'm not sure how to build the pdfbox-app jar, which is what my application
>> uses. I have successfully built the pdfbox.jar from the latest source but I
>> didn't see anything in the build.xml for producing the pdfbox-app.jar.
> Starting with PDFBox 1.0.0 the default build system is based on Maven [1]. The
> build.xml still remains because of some historical reasons.
>
>> Thanks,
>>
>> Eliot
>>
>>
>> SNIP
>
> BR
> Andreas Lehmkühler
> [1] http://pdfbox.apache.org/userguide/building_pdfbox.html
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
Success!
Using the 1.8.0 pdf-app jar produced from trunk, I got a good page image and
was then able to decode the QR code in it.
Thanks!
Cheers,
Eliot
On 12/13/12 3:34 PM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
> Hi,
>
> sorry for the late answer.
>
> Am 10.12.2012 17:06, schrieb Eliot Kimber:
>> OK, I'm looking for the revision to pagedrawer.Invoke mentioned in
>> https://issues.apache.org/jira/browse/PDFBOX-1445, which should correct my
>> issue, but I'm not finding it in trunk/
>>
>> Has the patch been committed or am I looking in the wrong place?
> These classes were changed
>
>
> pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/P
> DCcitt.java
>
> pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/P
> DJpeg.java
>
> pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/P
> DPixelMap.java
>
> pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/P
> DXObjectImage.java
>
> or just perform a "svn up" on your copy of the trunk.
>
>>
>> Thanks,
>>
>> Eliot
>>
>> On 12/9/12 11:02 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
>>
>>> Hi,
>>>
>>> Am 09.12.2012 16:45, schrieb Eliot Kimber:
>>>> At least using the 1.7.1 release, the combined image is not usable--it
>>>> doesn't reflect the application of the mask (at least I think that's what's
>>>> happening).
>>> I've run some test and the most recent trunk works.
>>>
>>>> I'm not sure how to build the pdfbox-app jar, which is what my application
>>>> uses. I have successfully built the pdfbox.jar from the latest source but I
>>>> didn't see anything in the build.xml for producing the pdfbox-app.jar.
>>> Starting with PDFBox 1.0.0 the default build system is based on Maven [1].
>>> The
>>> build.xml still remains because of some historical reasons.
>>>
>>>> Thanks,
>>>>
>>>> Eliot
>>>>
>>>>
>>>> SNIP
>>>
>>> BR
>>> Andreas Lehmkühler
>>> [1] http://pdfbox.apache.org/userguide/building_pdfbox.html
>>
>
>
> BR
> Andreas Lehmkühler
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
sorry for the late answer.
Am 10.12.2012 17:06, schrieb Eliot Kimber:
> OK, I'm looking for the revision to pagedrawer.Invoke mentioned in
> https://issues.apache.org/jira/browse/PDFBOX-1445, which should correct my
> issue, but I'm not finding it in trunk/
>
> Has the patch been committed or am I looking in the wrong place?
These classes were changed
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDCcitt.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDJpeg.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDPixelMap.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectImage.java
or just perform a "svn up" on your copy of the trunk.
>
> Thanks,
>
> Eliot
>
> On 12/9/12 11:02 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
>
>> Hi,
>>
>> Am 09.12.2012 16:45, schrieb Eliot Kimber:
>>> At least using the 1.7.1 release, the combined image is not usable--it
>>> doesn't reflect the application of the mask (at least I think that's what's
>>> happening).
>> I've run some test and the most recent trunk works.
>>
>>> I'm not sure how to build the pdfbox-app jar, which is what my application
>>> uses. I have successfully built the pdfbox.jar from the latest source but I
>>> didn't see anything in the build.xml for producing the pdfbox-app.jar.
>> Starting with PDFBox 1.0.0 the default build system is based on Maven [1]. The
>> build.xml still remains because of some historical reasons.
>>
>>> Thanks,
>>>
>>> Eliot
>>>
>>>
>>> SNIP
>>
>> BR
>> Andreas Lehmkühler
>> [1] http://pdfbox.apache.org/userguide/building_pdfbox.html
>
BR
Andreas Lehmkühler
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
OK, I'm looking for the revision to pagedrawer.Invoke mentioned in
https://issues.apache.org/jira/browse/PDFBOX-1445, which should correct my
issue, but I'm not finding it in trunk/
Has the patch been committed or am I looking in the wrong place?
Thanks,
Eliot
On 12/9/12 11:02 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
> Hi,
>
> Am 09.12.2012 16:45, schrieb Eliot Kimber:
>> At least using the 1.7.1 release, the combined image is not usable--it
>> doesn't reflect the application of the mask (at least I think that's what's
>> happening).
> I've run some test and the most recent trunk works.
>
>> I'm not sure how to build the pdfbox-app jar, which is what my application
>> uses. I have successfully built the pdfbox.jar from the latest source but I
>> didn't see anything in the build.xml for producing the pdfbox-app.jar.
> Starting with PDFBox 1.0.0 the default build system is based on Maven [1]. The
> build.xml still remains because of some historical reasons.
>
>> Thanks,
>>
>> Eliot
>>
>>
>> SNIP
>
> BR
> Andreas Lehmkühler
> [1] http://pdfbox.apache.org/userguide/building_pdfbox.html
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 09.12.2012 16:45, schrieb Eliot Kimber:
> At least using the 1.7.1 release, the combined image is not usable--it
> doesn't reflect the application of the mask (at least I think that's what's
> happening).
I've run some test and the most recent trunk works.
> I'm not sure how to build the pdfbox-app jar, which is what my application
> uses. I have successfully built the pdfbox.jar from the latest source but I
> didn't see anything in the build.xml for producing the pdfbox-app.jar.
Starting with PDFBox 1.0.0 the default build system is based on Maven [1]. The
build.xml still remains because of some historical reasons.
> Thanks,
>
> Eliot
>
>
>SNIP
BR
Andreas Lehmkühler
[1] http://pdfbox.apache.org/userguide/building_pdfbox.html
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
At least using the 1.7.1 release, the combined image is not usable--it
doesn't reflect the application of the mask (at least I think that's what's
happening).
I'm not sure how to build the pdfbox-app jar, which is what my application
uses. I have successfully built the pdfbox.jar from the latest source but I
didn't see anything in the build.xml for producing the pdfbox-app.jar.
Thanks,
Eliot
On 12/9/12 9:37 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
> Hi,
>
> Am 09.12.2012 15:36, schrieb Eliot Kimber:
>> Yes, I believe this is a masked image. I did a close reading of the PDF 1.7
>> spec and I think that's what I have.
>>
>> The sample I'm testing with can be found here:
>>
>> https://dl.dropbox.com/u/20078596/pdfScannedPageWithMaskedImage.pdf
>>
>> Here are the dictionary entries for the three XObjects in the document:
>>
>> 9 0 obj
>> <</BitsPerComponent
>> 8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
>> 19570/Name/image_bg0/Subtype/Image/Type/XObject/Width 850>>
>>
>> 10 0 obj
>> <</BitsPerComponent
>> 8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
>> 8521/Mask 11 0 R/Name/image_fg0/Subtype/Image/Type/XObject/Width 850>>
>>
>> 11 0 obj
>> <</BitsPerComponent 1/DecodeParms<</Columns 2550/K
>> -1>>/Filter/CCITTFaxDecode/Height 3300/ImageMask true/Length
>> 10266/Name/image_sel/Subtype/Image/Type/XObject/Width 2550>>
>>
>> So if I understand what this is saying, object 11 is the image mask applied
>> to object 10.
> Correct. FYI: did you ever try the PDFDebugger which comes with PDFBox? It's a
> tool to inspect the content of a pdf using a hierarchic tree view.
>
>> In my test code I made a little StreamEngine that simply reports on all
>> XObjects and writes any PDXObjectImage objects to the file system. This is
>> the output I get on this test document:
>>
>> processOperator(): objectName="image_bg0"
>> processOperator(): object type="PDJpeg"
>> processOperator(): image class=PDJpeg
>> processOperator(): imageWidth="850"
>> processOperator(): imageHeight="1100"
>> Creating file
>> /var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_bg0_0.jp
>> g
>> processOperator(): objectName="image_fg0"
>> processOperator(): object type="PDJpeg"
>> processOperator(): image class=PDJpeg
>> processOperator(): imageWidth="850"
>> processOperator(): imageHeight="1100"
>> Creating file
>> /var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_fg0_1.jp
>> g
>>
>> Where the objectName="image_bg0" line will be emitted for any XObject of any
>> type.
>>
>> So it looks like the ImageMask object is not being reported as an XObject.
> That's correct too. The mask is not a "standalone" XObjectImage, it's part of
> the fg_0 image. The mask represents the alpha channel of the image.
> bg_0 is painted first. fg_0 is painted on top of bg_0, due to the alpha
> channel
> most of fg_0 is treated as transparent and doesn't overwrite anything.
>
> I don't have a clue why the scanned picture is splitted into two parts. At
> least
> the most recent trunk version of PDFBox is able to handle this after fixing
> improving the mask handling, see [1] for further details.
>
> Maybe you should just use the combined image generated by PDFToImage.
>
>> Thanks,
>>
>> Eliot
>>
>> On 12/9/12 6:58 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
>>
>>> Hi,
>>>
>>> Am 06.12.2012 18:48, schrieb Eliot Kimber:
>>>> I am trying to find QR codes on PDFs that are scanned page images. My code
>>>> works fine for scans produced by my OfficeJet and for page images produced
>>>> out of Acrobat but scans produced by my client's eCopy ShareScan device
>>>> (according to the PDF metadata) are not usable.
>>>>
>>>> Looking into the PDF data stream, each page is represented by two images, a
>>>> "bg" image that is what I would expect for the page image, but very faint
>>>> grey, and a "fg" image that reflects the page content but with lots of grey
>>>> and ghosting.
>>> Sounds like masked images, but that's just a guess.
>>>
>>>> The PDF renderer must be combining these two images in some way to provide
>>>> the clear image I see in Acrobat.
>>>>
>>>> Is there something I can find in the PDF data stream that will tell me how
>>>> these images are combined and, if so, can anyone point me in the right
>>>> direction for processing these images? I am pretty new to Java image
>>>> processing so I'm not sure where to look or what to look for.
>>>>
>>>> The images themselves are repored by PDFBox as PDJpeg objects.
>>>>
>>>> I can provide a sample PDF page if it's needed.
>>> Due to some restrictions you can't attach it to a posting. Please post a
>>> download link referring to a public location or create an issue on jira [1]
>>>
>>>>
>>>> Thanks,
>>>>
>>>> Eliot
>>>>
>>>
>>>
>>> BR
>>> Andreas Lehmkühler
>>>
>>> [1] https://issues.apache.org/jira/browse/PDFBOX
>>
>
> BR
> Andreas Lehmkühler
>
> [1]https://issues.apache.org/jira/browse/PDFBOX-1445
>
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 09.12.2012 15:36, schrieb Eliot Kimber:
> Yes, I believe this is a masked image. I did a close reading of the PDF 1.7
> spec and I think that's what I have.
>
> The sample I'm testing with can be found here:
>
> https://dl.dropbox.com/u/20078596/pdfScannedPageWithMaskedImage.pdf
>
> Here are the dictionary entries for the three XObjects in the document:
>
> 9 0 obj
> <</BitsPerComponent
> 8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
> 19570/Name/image_bg0/Subtype/Image/Type/XObject/Width 850>>
>
> 10 0 obj
> <</BitsPerComponent
> 8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
> 8521/Mask 11 0 R/Name/image_fg0/Subtype/Image/Type/XObject/Width 850>>
>
> 11 0 obj
> <</BitsPerComponent 1/DecodeParms<</Columns 2550/K
> -1>>/Filter/CCITTFaxDecode/Height 3300/ImageMask true/Length
> 10266/Name/image_sel/Subtype/Image/Type/XObject/Width 2550>>
>
> So if I understand what this is saying, object 11 is the image mask applied
> to object 10.
Correct. FYI: did you ever try the PDFDebugger which comes with PDFBox? It's a
tool to inspect the content of a pdf using a hierarchic tree view.
> In my test code I made a little StreamEngine that simply reports on all
> XObjects and writes any PDXObjectImage objects to the file system. This is
> the output I get on this test document:
>
> processOperator(): objectName="image_bg0"
> processOperator(): object type="PDJpeg"
> processOperator(): image class=PDJpeg
> processOperator(): imageWidth="850"
> processOperator(): imageHeight="1100"
> Creating file
> /var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_bg0_0.jp
> g
> processOperator(): objectName="image_fg0"
> processOperator(): object type="PDJpeg"
> processOperator(): image class=PDJpeg
> processOperator(): imageWidth="850"
> processOperator(): imageHeight="1100"
> Creating file
> /var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_fg0_1.jp
> g
>
> Where the objectName="image_bg0" line will be emitted for any XObject of any
> type.
>
> So it looks like the ImageMask object is not being reported as an XObject.
That's correct too. The mask is not a "standalone" XObjectImage, it's part of
the fg_0 image. The mask represents the alpha channel of the image.
bg_0 is painted first. fg_0 is painted on top of bg_0, due to the alpha channel
most of fg_0 is treated as transparent and doesn't overwrite anything.
I don't have a clue why the scanned picture is splitted into two parts. At least
the most recent trunk version of PDFBox is able to handle this after fixing
improving the mask handling, see [1] for further details.
Maybe you should just use the combined image generated by PDFToImage.
> Thanks,
>
> Eliot
>
> On 12/9/12 6:58 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
>
>> Hi,
>>
>> Am 06.12.2012 18:48, schrieb Eliot Kimber:
>>> I am trying to find QR codes on PDFs that are scanned page images. My code
>>> works fine for scans produced by my OfficeJet and for page images produced
>>> out of Acrobat but scans produced by my client's eCopy ShareScan device
>>> (according to the PDF metadata) are not usable.
>>>
>>> Looking into the PDF data stream, each page is represented by two images, a
>>> "bg" image that is what I would expect for the page image, but very faint
>>> grey, and a "fg" image that reflects the page content but with lots of grey
>>> and ghosting.
>> Sounds like masked images, but that's just a guess.
>>
>>> The PDF renderer must be combining these two images in some way to provide
>>> the clear image I see in Acrobat.
>>>
>>> Is there something I can find in the PDF data stream that will tell me how
>>> these images are combined and, if so, can anyone point me in the right
>>> direction for processing these images? I am pretty new to Java image
>>> processing so I'm not sure where to look or what to look for.
>>>
>>> The images themselves are repored by PDFBox as PDJpeg objects.
>>>
>>> I can provide a sample PDF page if it's needed.
>> Due to some restrictions you can't attach it to a posting. Please post a
>> download link referring to a public location or create an issue on jira [1]
>>
>>>
>>> Thanks,
>>>
>>> Eliot
>>>
>>
>>
>> BR
>> Andreas Lehmkühler
>>
>> [1] https://issues.apache.org/jira/browse/PDFBOX
>
BR
Andreas Lehmkühler
[1]https://issues.apache.org/jira/browse/PDFBOX-1445
Re: Handling Graphics from Scanned PDF
Posted by Eliot Kimber <ek...@rsicms.com>.
Yes, I believe this is a masked image. I did a close reading of the PDF 1.7
spec and I think that's what I have.
The sample I'm testing with can be found here:
https://dl.dropbox.com/u/20078596/pdfScannedPageWithMaskedImage.pdf
Here are the dictionary entries for the three XObjects in the document:
9 0 obj
<</BitsPerComponent
8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
19570/Name/image_bg0/Subtype/Image/Type/XObject/Width 850>>
10 0 obj
<</BitsPerComponent
8/ColorSpace/DeviceGray/Filter[/FlateDecode/DCTDecode]/Height 1100/Length
8521/Mask 11 0 R/Name/image_fg0/Subtype/Image/Type/XObject/Width 850>>
11 0 obj
<</BitsPerComponent 1/DecodeParms<</Columns 2550/K
-1>>/Filter/CCITTFaxDecode/Height 3300/ImageMask true/Length
10266/Name/image_sel/Subtype/Image/Type/XObject/Width 2550>>
So if I understand what this is saying, object 11 is the image mask applied
to object 10.
In my test code I made a little StreamEngine that simply reports on all
XObjects and writes any PDXObjectImage objects to the file system. This is
the output I get on this test document:
processOperator(): objectName="image_bg0"
processOperator(): object type="PDJpeg"
processOperator(): image class=PDJpeg
processOperator(): imageWidth="850"
processOperator(): imageHeight="1100"
Creating file
/var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_bg0_0.jp
g
processOperator(): objectName="image_fg0"
processOperator(): object type="PDJpeg"
processOperator(): image class=PDJpeg
processOperator(): imageWidth="850"
processOperator(): imageHeight="1100"
Creating file
/var/folders/_r/zht66_tx2lzcz4k18rzbxc240000gp/T/TestPdfUtils/image_fg0_1.jp
g
Where the objectName="image_bg0" line will be emitted for any XObject of any
type.
So it looks like the ImageMask object is not being reported as an XObject.
Thanks,
Eliot
On 12/9/12 6:58 AM, "Andreas Lehmkuehler" <an...@lehmi.de> wrote:
> Hi,
>
> Am 06.12.2012 18:48, schrieb Eliot Kimber:
>> I am trying to find QR codes on PDFs that are scanned page images. My code
>> works fine for scans produced by my OfficeJet and for page images produced
>> out of Acrobat but scans produced by my client's eCopy ShareScan device
>> (according to the PDF metadata) are not usable.
>>
>> Looking into the PDF data stream, each page is represented by two images, a
>> "bg" image that is what I would expect for the page image, but very faint
>> grey, and a "fg" image that reflects the page content but with lots of grey
>> and ghosting.
> Sounds like masked images, but that's just a guess.
>
>> The PDF renderer must be combining these two images in some way to provide
>> the clear image I see in Acrobat.
>>
>> Is there something I can find in the PDF data stream that will tell me how
>> these images are combined and, if so, can anyone point me in the right
>> direction for processing these images? I am pretty new to Java image
>> processing so I'm not sure where to look or what to look for.
>>
>> The images themselves are repored by PDFBox as PDJpeg objects.
>>
>> I can provide a sample PDF page if it's needed.
> Due to some restrictions you can't attach it to a posting. Please post a
> download link referring to a public location or create an issue on jira [1]
>
>>
>> Thanks,
>>
>> Eliot
>>
>
>
> BR
> Andreas Lehmkühler
>
> [1] https://issues.apache.org/jira/browse/PDFBOX
--
Eliot Kimber
Senior Solutions Architect, RSI Content Solutions
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.rsicms.com
www.rsuitecms.com
Book: DITA For Practitioners, from XML Press,
http://xmlpress.net/publications/dita/practitioners-1/
Re: Handling Graphics from Scanned PDF
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 06.12.2012 18:48, schrieb Eliot Kimber:
> I am trying to find QR codes on PDFs that are scanned page images. My code
> works fine for scans produced by my OfficeJet and for page images produced
> out of Acrobat but scans produced by my client's eCopy ShareScan device
> (according to the PDF metadata) are not usable.
>
> Looking into the PDF data stream, each page is represented by two images, a
> "bg" image that is what I would expect for the page image, but very faint
> grey, and a "fg" image that reflects the page content but with lots of grey
> and ghosting.
Sounds like masked images, but that's just a guess.
> The PDF renderer must be combining these two images in some way to provide
> the clear image I see in Acrobat.
>
> Is there something I can find in the PDF data stream that will tell me how
> these images are combined and, if so, can anyone point me in the right
> direction for processing these images? I am pretty new to Java image
> processing so I'm not sure where to look or what to look for.
>
> The images themselves are repored by PDFBox as PDJpeg objects.
>
> I can provide a sample PDF page if it's needed.
Due to some restrictions you can't attach it to a posting. Please post a
download link referring to a public location or create an issue on jira [1]
>
> Thanks,
>
> Eliot
>
BR
Andreas Lehmkühler
[1] https://issues.apache.org/jira/browse/PDFBOX