Extract pdf file from a sql db

  • certainly possible, but you probably need a bit more information.

    this example here, you could adapt, and is assuming there is an identity/primary key to the table.

    If you can install CLR on a database, i personally use a version of Elliot Witlows Common Language Runtime example he published here:

    http://nclsqlclrfile.codeplex.com/

    --MSPSaveFileImage

    -- Parameters: @FilePath,@FileName,@FileBytes

    -- purpose: given an varbinary image column in a table, write that image to disk

    -- usage:

    --assumes table and the file from the example above for dbo.MFGetFileImage exists already.

    declare @myfile varbinary(max)

    SELECT @myfile = rawimage FROM myImages WHERE id = 1

    EXEC dbo.MSPSaveFileImage 'C:\Data','spinning.gif',@myfile

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi, Mark.

    Thanks for sharing your problem. When it comes to pdf processing, I have another question to ask you. I wonder whether text extraction from pdf files[/url] is much simpler than pdf to text conversion[/url] process. Thre's something wrong with my pdf viewer. I want to look for a method to help with the relevant process. Any suggestion will be appreciated. Thanks in advance.

    Best regards,

    Pan

  • So I am new to SQL forums, so please bear with me. I have a similar issue. I have PDF's and JPG's stored within a table. Each record is associated with a session number as the number of PDF or JPG files per "session" can vary. I would like to export the files using the filename within the record for each file in a directory named using the session number. Any ideas/concerns?

Viewing 3 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply