Getting a *.pdf file and saving to db

Am using PB10, SQL Server 2000 on WINXP Pro.  I have a
requirement to take a scanned document in *.pdf format and
put it in the db.  The scanned document will be sent to the
local workstation.  At this point, within the application, I
would like to navigage to this directory, identify the
scanned document, rename it, and then save it to the db.  I
know you have to use Updateblob here to save the file, but
don't really know the specifics on what I have to do, from
navigating to the *.pdf to placing it in the db.  Help
requested....
0
William
11/18/2004 1:45:51 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

6 Replies
807 Views

Similar Articles

[PageSpeed] 23

string docname, named
integer li_FileNum, loops, i, li_value

blob lb_pdf


li_value = GetFileOpenName("Select picture",  &
	+ docname, named, "PDF",  &
	+ "AcrobatFiles (*.PDF),*.PDF")

IF li_value = 1 THEN

	li_FileNum = FileOpen(docname,  &
		StreamMode!, Read!, LockRead!)


	// Read the file

	bytes_read = FileReadEx(li_FileNum, lb_pdf)
	FileClose(li_fileNum)
                updateblob myTable set blob_column = :lb_pdf
                where key_column = :myKey;
end if

The record must exist before you do the update.

hth

JMR
> Am using PB10, SQL Server 2000 on WINXP Pro.  I have a
> requirement to take a scanned document in *.pdf format and
> put it in the db.  The scanned document will be sent to
> the local workstation.  At this point, within the
> application, I would like to navigage to this directory,
> identify the scanned document, rename it, and then save it
> to the db.  I know you have to use Updateblob here to save
> the file, but don't really know the specifics on what I
> have to do, from navigating to the *.pdf to placing it in
> the db.  Help requested....
0
JMR
11/18/2004 2:43:00 PM
Pay atention to the 32 K limits when reading a file opened with StreamMode! 
.....

Regards

<JMR> wrote in message news:419cb4f4.3837.1681692777@sybase.com...
> string docname, named
> integer li_FileNum, loops, i, li_value
>
> blob lb_pdf
>
>
> li_value = GetFileOpenName("Select picture",  &
> + docname, named, "PDF",  &
> + "AcrobatFiles (*.PDF),*.PDF")
>
> IF li_value = 1 THEN
>
> li_FileNum = FileOpen(docname,  &
> StreamMode!, Read!, LockRead!)
>
>
> // Read the file
>
> bytes_read = FileReadEx(li_FileNum, lb_pdf)
> FileClose(li_fileNum)
>                updateblob myTable set blob_column = :lb_pdf
>                where key_column = :myKey;
> end if
>
> The record must exist before you do the update.
>
> hth
>
> JMR
>> Am using PB10, SQL Server 2000 on WINXP Pro.  I have a
>> requirement to take a scanned document in *.pdf format and
>> put it in the db.  The scanned document will be sent to
>> the local workstation.  At this point, within the
>> application, I would like to navigage to this directory,
>> identify the scanned document, rename it, and then save it
>> to the db.  I know you have to use Updateblob here to save
>> the file, but don't really know the specifics on what I
>> have to do, from navigating to the *.pdf to placing it in
>> the db.  Help requested.... 


0
Juli
11/18/2004 2:57:57 PM
That was with FileRead... not with FileReadEX according to
the documentation.

JMR
> Pay atention to the 32 K limits when reading a file opened
> with StreamMode!  .....
>
> Regards
>
> <JMR> wrote in message
> > news:419cb4f4.3837.1681692777@sybase.com... string
> > docname, named integer li_FileNum, loops, i, li_value
> >
> > blob lb_pdf
> >
> >
> > li_value = GetFileOpenName("Select picture",  &
> > + docname, named, "PDF",  &
> > + "AcrobatFiles (*.PDF),*.PDF")
> >
> > IF li_value = 1 THEN
> >
> > li_FileNum = FileOpen(docname,  &
> > StreamMode!, Read!, LockRead!)
> >
> >
> > // Read the file
> >
> > bytes_read = FileReadEx(li_FileNum, lb_pdf)
> > FileClose(li_fileNum)
> >                updateblob myTable set blob_column =
> >                :lb_pdf where key_column = :myKey;
> > end if
> >
> > The record must exist before you do the update.
> >
> > hth
> >
> > JMR
> >> Am using PB10, SQL Server 2000 on WINXP Pro.  I have a
> >> requirement to take a scanned document in *.pdf format
> and >> put it in the db.  The scanned document will be
> sent to >> the local workstation.  At this point, within
> the >> application, I would like to navigage to this
> directory, >> identify the scanned document, rename it,
> and then save it >> to the db.  I know you have to use
> Updateblob here to save >> the file, but don't really know
> the specifics on what I >> have to do, from navigating to
> the *.pdf to placing it in >> the db.  Help requested....
>
>
0
JMR
11/18/2004 3:46:14 PM
Thank you JMR & Juan:  I will try your suggestions out.
Bill....

> That was with FileRead... not with FileReadEX according to
> the documentation.
>
> JMR
> > Pay atention to the 32 K limits when reading a file
> > opened with StreamMode!  .....
> >
> > Regards
> >
> > <JMR> wrote in message
> > > news:419cb4f4.3837.1681692777@sybase.com... string
> > > docname, named integer li_FileNum, loops, i, li_value
> > >
> > > blob lb_pdf
> > >
> > >
> > > li_value = GetFileOpenName("Select picture",  &
> > > + docname, named, "PDF",  &
> > > + "AcrobatFiles (*.PDF),*.PDF")
> > >
> > > IF li_value = 1 THEN
> > >
> > > li_FileNum = FileOpen(docname,  &
> > > StreamMode!, Read!, LockRead!)
> > >
> > >
> > > // Read the file
> > >
> > > bytes_read = FileReadEx(li_FileNum, lb_pdf)
> > > FileClose(li_fileNum)
> > >                updateblob myTable set blob_column =
> > >                :lb_pdf where key_column = :myKey;
> > > end if
> > >
> > > The record must exist before you do the update.
> > >
> > > hth
> > >
> > > JMR
> > >> Am using PB10, SQL Server 2000 on WINXP Pro.  I have
> > a >> requirement to take a scanned document in *.pdf
> > format and >> put it in the db.  The scanned document
> > will be sent to >> the local workstation.  At this point
> > , within the >> application, I would like to navigage to
> > this directory, >> identify the scanned document, rename
> > it, and then save it >> to the db.  I know you have to
> > use Updateblob here to save >> the file, but don't
> > really know the specifics on what I >> have to do, from
> > navigating to the *.pdf to placing it in >> the db.
> Help requested.... >
> >
0
William
11/18/2004 3:55:27 PM
So sorry ... I didnt read the correct sentence .. at a glance it looked like 
FileRead.

�FileReadEx is PB10?

<JMR> wrote in message news:419cc3c4.3b43.1681692777@sybase.com...
> That was with FileRead... not with FileReadEX according to
> the documentation.
>
> JMR
>> Pay atention to the 32 K limits when reading a file opened
>> with StreamMode!  .....
>>
>> Regards
>>
>> <JMR> wrote in message
>> > news:419cb4f4.3837.1681692777@sybase.com... string
>> > docname, named integer li_FileNum, loops, i, li_value
>> >
>> > blob lb_pdf
>> >
>> >
>> > li_value = GetFileOpenName("Select picture",  &
>> > + docname, named, "PDF",  &
>> > + "AcrobatFiles (*.PDF),*.PDF")
>> >
>> > IF li_value = 1 THEN
>> >
>> > li_FileNum = FileOpen(docname,  &
>> > StreamMode!, Read!, LockRead!)
>> >
>> >
>> > // Read the file
>> >
>> > bytes_read = FileReadEx(li_FileNum, lb_pdf)
>> > FileClose(li_fileNum)
>> >                updateblob myTable set blob_column =
>> >                :lb_pdf where key_column = :myKey;
>> > end if
>> >
>> > The record must exist before you do the update.
>> >
>> > hth
>> >
>> > JMR
>> >> Am using PB10, SQL Server 2000 on WINXP Pro.  I have a
>> >> requirement to take a scanned document in *.pdf format
>> and >> put it in the db.  The scanned document will be
>> sent to >> the local workstation.  At this point, within
>> the >> application, I would like to navigage to this
>> directory, >> identify the scanned document, rename it,
>> and then save it >> to the db.  I know you have to use
>> Updateblob here to save >> the file, but don't really know
>> the specifics on what I >> have to do, from navigating to
>> the *.pdf to placing it in >> the db.  Help requested....
>>
>> 


0
Juli
11/18/2004 4:24:01 PM
Yup, PB10

> So sorry ... I didnt read the correct sentence .. at a
> glance it looked like  FileRead.
>
> =bfFileReadEx is PB10?
>
> <JMR> wrote in message
> > news:419cc3c4.3b43.1681692777@sybase.com... That was
> > with FileRead... not with FileReadEX according to the
> documentation. >
> > JMR
> >> Pay atention to the 32 K limits when reading a file
> opened >> with StreamMode!  .....
> >>
> >> Regards
> >>
> >> <JMR> wrote in message
> >> > news:419cb4f4.3837.1681692777@sybase.com... string
> >> > docname, named integer li_FileNum, loops, i, li_value
> >> >
> >> > blob lb_pdf
> >> >
> >> >
> >> > li_value =3d GetFileOpenName("Select picture",  &
> >> > + docname, named, "PDF",  &
> >> > + "AcrobatFiles (*.PDF),*.PDF")
> >> >
> >> > IF li_value =3d 1 THEN
> >> >
> >> > li_FileNum =3d FileOpen(docname,  &
> >> > StreamMode!, Read!, LockRead!)
> >> >
> >> >
> >> > // Read the file
> >> >
> >> > bytes_read =3d FileReadEx(li_FileNum, lb_pdf)
> >> > FileClose(li_fileNum)
> >> >                updateblob myTable set blob_column =3d
> >> >                :lb_pdf where key_column =3d :myKey;
> >> > end if
> >> >
> >> > The record must exist before you do the update.
> >> >
> >> > hth
> >> >
> >> > JMR
> >> >> Am using PB10, SQL Server 2000 on WINXP Pro.  I have
> a >> >> requirement to take a scanned document in *.pdf
> format >> and >> put it in the db.  The scanned document
> will be >> sent to >> the local workstation.  At this
> point, within >> the >> application, I would like to
> navigage to this >> directory, >> identify the scanned
> document, rename it, >> and then save it >> to the db.  I
> know you have to use >> Updateblob here to save >> the
> file, but don't really know >> the specifics on what I >>
> have to do, from navigating to >> the *.pdf to placing it
> in >> the db.  Help requested.... >>
> >>
>
>
0
JMR
11/18/2004 6:28:54 PM
Reply:

Similar Artilces:

How do you get a PDF file saved to a directory without clicking a button in PowerBuilder (using some kind of scheduler such as Windows Scheduler)?
Hi, In PowerBuilder 11.5, we can create a PDF file of the datawindow report at the click of a button in a window. However, we would like to know now to create some scheduler where a click of a button is not required. Is there a way to create a PDF file automatically everyday at, let's say, at noon? It has to be some kind of functionality that can go into Powerbuilder and do the PDF process and quit out of it. How do I do that? Busy Beaver Well, if your button does create that PDF file after retrieving the datawindow, what prevents you of creating a small app that retrieves,...

saving pdf files to db.
Hi Everyone. I am new to this field, and apologize if some explanations are not very clear. Here is my problem: I need to save pdf file images to db. I was able to store binary data with ADO AddNew method. I have to store more then a thousand images, and it takes a very long time to complete the job. I tried to do batch update, but I wasn't successful in that. I was thinking if I can execute insert statement, that can make the process quicker. The problem is I cannot figure out the syntax to put in insert statement for binary data. Thanks. Alla. Hello Alla, ...

Getting error when saving to my db. Trying to limit number of character saved to db.
I am using the following INSERT command in my Source.  The 'notes' field in my DB is VarChar 7000 characters.  I am trying to limit the amout of characters that can be saved to 7000 characters to my db. InsertCommand="INSERT INTO [info] ([class_name], [info_date], LEFT([notes], 7000)) VALUES (@class_name, @info_date, @notes)"> If I try to submit more than 7000 characters I get the following error message. "An error occured while entering this record. Please verify you have entered data in the correct format." I thought that the Left 7000 would limit it to the fir...

PDF::API2 module example for edit pdf and save new pdf file
Dear sirs, I want to learn more about open pdf file and edit and save some other new pdf file. I use PDF::API2 module, Kindly give me an example... Thanking you Regards Baskaran NK baskaran wrote: > Dear sirs, > > I want to learn more about open pdf file and edit and save some other new > pdf file. > I use PDF::API2 module, Kindly give me an example... > > Thanking you > > Regards > Baskaran NK > > > http://search.cpan.org/src/AREIBENS/PDF-API2-0.41/examples/ http://danconia.org ...

when saving a file (save page as) please have option of saving file the title and not the actual file name
Name: Dan Kelleher Product: Firefox Summary: when saving a file (save page as) please have option of saving file the title and not the actual file name Comments: I like you browser better than windows explorer but windows has one feature that I wish you had. When saving a file (save page as) please have option of saving file the title and not the actual file name. Many files have number names that have no relationship to the web page. Saving as the page title gives an exact indication of the topic of the page saved. Keep up the good work. see http://www.sciencedaily.com/news/...

Error in Saving Datawindow into PDF file Using Ghostscript
We are getting error while saving Powerbuilder Datawindow into PDF using ghostscript in WIndows 7 OS . Same is working fine in Windows Xp and windows 2000 . Does Windows 7 support the same . If yes Pls give some solution It would help if you told us what version of PowerBuilder you are using. <ARUN> wrote in message news:4ab30cdd.59aa.1681692777@sybase.com... > > We are getting error while saving Powerbuilder Datawindow > into PDF using ghostscript in WIndows 7 OS . Same is working > fine in Windows Xp and windows 2000 . > > Does Windows 7 support ...

saving and retrieving various (doc, xls, pdf, etc) files attached to DB row
D7; Sybase ASA 9.0; BDE/ODBC I have a client who wants to attach various document types to rows in the DB. Do I attempt to store them as Blob's or save the document location and open it with its native program? Any suggestions of the best technique, alternate technique or methodology using Delphi 7 or Delphi 2007? Thanks -- Bill Skelton Landmark Data Systems, Inc. Two Old River Place, Suite L Jackson, MS 39202-3435 601-362-0303 Edited by: Bill Skelton on Aug 19, 2008 3:39 PM Bill Skelton schrieb: > D7; Sybase ASA 9.0; BDE/ODBC > > I have a client ...

Convert Or Save Pdf file to html file
I want to convert or save pdf file to html programmatically through asp.net 1.1 & C#.Anyone knows solution please let me know coz I do a lot of search but didn't find any kind of solution.  Thanks & regards.   hi, check this link, http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/d835c1c9-0d04-4cb9-8d08-39e68ee911fd/...

downloading files, get errors, as file could not be saved.
Name: Egon Mainey Email: p33ka8oo_at_hotmail.com Product: Deer Park Summary: downloading files, get errors, as file could not be saved. Comments: I've tried to download a few files from nvidia and asus.tw, both times I get the following C:/docume~1\admin~1\locals~1\temp\oivoh98f.exe could not be saved, because the source file could not be read. I don't know weather it is a problem with XP64 or deerpark. I've had to resort to IE to get the files, which worked fine. If I've mad a mistake let me know or point me in the direction of the work around, you got m...

exclude file extension (.pdf) when saving file name with fileupload?
Hi, I have the following code to save the file name, file size and file type from a file uploaded:Dim fileName As String = FileUpload1.PostedFile.FileNameDim filesize As Integer = sender.parent.findcontrol("FileUpload1").PostedFile.ContentLength / 1000Dim filetype As String = FileUpload1.PostedFile.ContentTypeThis works great, but i'm wanting to exclude the file extension from the file name, eg. so filename1.pdf appears as just filename1 What what i have to add to the above code to be able to do this?  TIA There's probably a slicker way... but you can : str...

How to improve the performance of getting DB Records from older DB files
I want to read DB Records from older DB files(I used Blackfish SQL Database),and then write the readed Record to the Using DB(the using DB has more fields than the older). Now I resolved this problem by getting fields name and value from the older DB, and then making their a 'insert SQL statement', finally using this SQL to write Record into current DB. while the older DB having a large amount records, the above prcedure will cost a lot of time. Anyone can help to solve this problem? ...

Firefox 24
I'm trying to save a PDF file and they are defaulting to xxx.cgi files from my bank sites (2 different banks), instead of PDF files as they used to. Is there a setting to change this? I changed my default open option for PDF files from Adobe X back to Nitro Pro after an update to Adobe Reader yesterday changed them without asking. I can force the save to PDF file and it works that way, just very annoying. Is there anything else I can do to get PDF file extension default back? When I did a Google search, I only found old bug reports on Mozilla from many years ago. I se...

WebDatawindow.net Save As PDF creates 0 byte pdf file
Hello all, I am having issues with the save as pdf function of the web datawindow. I am using the ghostwriter ps method and have confirmed with another app that the ps generation is working properly. I have also confirmed that the datawindow is throwing a ps file in the windows temp directory during execution of this method. However, the pdf file generated is always 0 bytes. For whatever reason i am finding the documentation hard to understand and im sure its a setup problem on my behalf. Like placement of the "gs" directory and needed dl's missing or not ...

upload data from an excel file directly into db without saving the excel file
Hi, I want to give users the ability to upload an excel file and then take the data out of the first column in that excel file and insert that into my db.  NB The users will be told to only put data into the first column. I know how to put the input file on my webform and have them upload the file to the server - but i think there must be a better way as i dont want to keep the excel file - just take the info out of the column and discard the excel file. Does anyone have any ideas/tutorials on best way to do this. Thanks...   I have done similar thing, but you can not j...

Web resources about - Getting a *.pdf file and saving to db - sybase.powerbuilder.general

America First or World War III
"If you're in favor of World War III, you have your candidate." So said Rand Paul, looking directly at Gov. Chris Christie, who had just responded ...

Trump Spox: Putin Praise Was ‘Not an Endorsement’
Donald Trump spokeswoman Katrina Pierson Thursday denied that Russian president Vladimir Putin endorsed the Republican candidate, insisting Putin ...

Did The Feds Seize Ultra-Rare Wu-Tang Clan Album From ‘Pharma Bro’ Martin Shkreli?
With Martin Shkreli’s recent arrest on charges of securities fraud, it seems that the former hedge fund manager turned pharmacological entrepreneur ...

Analysis: Williams is the obvious successor to Cook, Schiller to relieve Cue of some responsibilities ...
Mark Gurman / 9to5Mac : Analysis: Williams is the obvious successor to Cook, Schiller to relieve Cue of some responsibilities, Tor Myhren succeeds ...

Words, Meaning and Ted Cruz
Ted Cruz should have an uphill battle for the Republican nomination. Many of the leading pundits, personalities, and legislative leaders identified ...

Two US Men Face Terror Charges as UN Votes to Sanction ISIS
Two US Men Face Terror Charges as UN Votes to Sanction ISIS

Local Economist Explains the Interest Rate Hoopla
Economist Alan Harvey shows me what the raise in the interest rate looks like. Charles Mudede On Wednesday, Fed chairwoman Janet Yellen raised ...

Windows 10 Mobile Update For Older Devices Arriving In 2016
It is always a nice and good thing to have the latest and greatest version of whatever software or operating system that you are using for a ...

WhatsApp back online in Brazil after temporarily block
WhatsApp back online in Brazil after temporarily block

Notable Mistrials in Cases of Police Deaths
Hung juries not uncommon in high-profile cases involving use of force by police

Resources last updated: 12/18/2015 4:43:08 AM