Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:00:56+00:00 2026-06-07T02:00:56+00:00

I need to be able to read QR codes from PDF files. I am

  • 0

I need to be able to read QR codes from PDF files. I am using thoughtworks.QRCode, which accepts an image and returns the data held in the QR code. I have that part working.

However, I need to be able to accept a multipage PDF file and send each page as an image to the QR reader. I then need to save each page of the original PDF as single page PDF’s named after the data contained in the QR codes.

What library would you recommend I use for this project? Many that I have seen create permanent images, but I just want temporary ones. Is there something that would easily allow me to do this? Is there perhaps another QR reader that can read pdfs?

Thanks for any advice you might be able to lend!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:00:59+00:00Added an answer on June 7, 2026 at 2:00 am

    I used itextsharp and libtiff.NET to extract tiff images from PDF files into memory. Bottom line is itextsharp will give you access to the images, but if they are encoded, you need to do the encoding yourself or use another library, which is where libtiff.NET came in.

    The following code was modified based on an answer to a question I asked: PDF Add Text and Flatten

    Private Shared Function ExtractImages(ByVal pdf As Byte()) As List(Of Byte())
        Dim images As New List(Of Byte())
        Dim reader As New PdfReader(pdf)
    
        If (reader IsNot Nothing) Then
            ' Loop through all of the references in the PDF.
            For refIndex = 0 To (reader.XrefSize - 1)
                ' Get the object.
                Dim obj = reader.GetPdfObject(refIndex)
    
                ' Make sure we have something and that it is a stream.
                If (obj IsNot Nothing) AndAlso obj.IsStream() Then
                    ' Cast it to a dictionary object.
                    Dim pdfDict = DirectCast(obj, iTextSharp.text.pdf.PdfDictionary)
    
                    ' See if it has a subtype property that is set to /IMAGE.
                    If pdfDict.Contains(iTextSharp.text.pdf.PdfName.SUBTYPE) AndAlso (pdfDict.Get(iTextSharp.text.pdf.PdfName.SUBTYPE).ToString() = iTextSharp.text.pdf.PdfName.IMAGE.ToString()) Then
                        ' Grab various properties of the image.
                        Dim filter = pdfDict.Get(iTextSharp.text.pdf.PdfName.FILTER).ToString()
                        Dim width = pdfDict.Get(iTextSharp.text.pdf.PdfName.WIDTH).ToString()
                        Dim height = pdfDict.Get(iTextSharp.text.pdf.PdfName.HEIGHT).ToString()
                        Dim bpp = pdfDict.Get(iTextSharp.text.pdf.PdfName.BITSPERCOMPONENT).ToString()
    
                        ' Grab the raw bytes of the image
                        Dim bytes = PdfReader.GetStreamBytesRaw(DirectCast(obj, PRStream))
    
                        ' Images can be encoded in various ways. 
                        ' All of our images are encoded with a single filter.
                        ' If there is a need to decode another filter, it will need to be added.
                        If (filter = iTextSharp.text.pdf.PdfName.CCITTFAXDECODE.ToString()) Then
                            Using ms = New MemoryStream()
                                Using tiff As Tiff = tiff.ClientOpen("memory", "w", ms, New TiffStream())
                                    tiff.SetField(TiffTag.IMAGEWIDTH, width)
                                    tiff.SetField(TiffTag.IMAGELENGTH, height)
                                    tiff.SetField(TiffTag.COMPRESSION, Compression.CCITTFAX4)
                                    tiff.SetField(TiffTag.BITSPERSAMPLE, bpp)
                                    tiff.SetField(TiffTag.SAMPLESPERPIXEL, 1)
    
                                    tiff.WriteRawStrip(0, bytes, bytes.Length)
                                    tiff.Flush()
                                    images.Add(ms.ToArray())
                                    tiff.Close()
                                End Using
                            End Using
                        Else
                            Throw New NotImplementedException("Decoding this filter has not been implemented")
                        End If
                    End If
                End If
            Next
        End If
    
        Return images
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to read card and company identification data from European
I need to be able to read the value of my attribute from within
I need to be able to read from a dropdown box on a page
I need to be able to read xml/rss from a https web site in
I need to extract images from a FB fan page. I'm able to read
I need to read a large (2000x2000) matrix of binary data from a file
I need to be able to read a list of variables that follow certain
I need to be able to read the contents of a Mysql database 10
I've a requirement that I need to read an excel sheet programmatically using asp.net/C#
I'm using DPAPI in C++ to encrypt some data that I need to store

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.