Re: [WebDNA] writing pdfs on the fly (Avery labels #5160)
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 105044
interpreted = N
texte = Govinda,I too had the same problem at first, until I made use of the [raw][/raw]tags around everything (including line endings) that didn't need to beinterpreted by WebDNA.As far as number of pages goes, that is not exactly what I meant toconvey. What I meant was outputting a dynamic number of pages. Thisprocess will work fine if your pdf is more than one page, just don'texpect to output a pdf with n number of pages.Does that make sense?One other bad part of using this method is that once the pdf is made andconverted to ascii text, you cannot edit the pdf document. If you doneed to edit the pdf itself, you would have to completely rebuild theascii version and then re-add the WebDNA. I've done it and it's a pain..=.Having said that however, the pdfs I'm outputting have been inproduction now for more than 5 years without any hassle...MarcGovinda wrote:> rearranged for bottom posting.. see below:>=20>> Govinda wrote:>>> Hi All>>>>>> I am working to write PDFs on the fly with webdna (my first time with>>> this).>>> I thought I was in luck when I saw the sample on the webdna site>>> because it is said to be the exact PDF template I need (Avery labels>>> #5160).>>>>>> So far as far as I got is to see is that the sample (avery) I>>> downloaded from the webdna site seems contradictory in that it says>>> that it will choke on a null char (the readme says "should be ascii>>> only") and then in that Avery example it tries to include a file =20>>> (the>>> pdf template) which contains a null char! (Did the author test =20>>> this?!)>>> I do not know about the guts of a pdf to know how to go about =20>>> tweaking>>> the template to make it pure ascii (null char-free) and have it still>>> work as that real pdf (formatted for avery labels 5160).>>> The sample directions (readme.txt) say,>>> "Create a pdf file (I used Distiller for this demo)>>> in ASCII text format so there isn't any binary data>>> in the file (so null characters won't cause problems).">>>>>> The final pdf I want to write may have more than one page.>>>>>> I'd love to find success here to solve my own problem and also to>>> embellish the samples for the webdna site.>>>>>> It seems I need (at least) a sample pdf template (for the Avery =20>>> labels>>> #5160) which does not contain any binary data (null chars), right?>>> Can anyone give me some pointers?>>>>>> ------------>>> Govinda>>> govinda.webdnatalk@gmail.com>=20>> Govinda,>> I used the same approach several years ago using the example you =20>> site as>> a beginning approach. In my experience this method of creating a pdf>> on the fly is not a very good one, especially if you are in fact>> planning to output a dynamic number of pages.>> What that example is "OK" for is for outputting a basically static pdf>> file with dynamic values. You simply include WebDNA where you want =20>> your>> dynamic values to be populated right in the ascii text.>>>> To populate the pdf with the WebDNA values I used the following =20>> approach>> to write the file:>> [!]###### Write new PDF file for this order #######[/!]>> [writefile file=3Ddb/orders/[cart].pdf&secure=3Df][include>> file=3Dco.pdf[formvariables name=3D_&exact=3DF]&[getchars>> start=3D2][name][/getchars]=3D[url][value][/url][/=20>> formvariables=20>> ]&_Co_Num=20>> =3D[_Co_Num]&_Dept=3D[Dept]&Total_Price=3D[_Total_Price]&_cart=3D[cart=]][/=20>> writefile]>>>> The file named co.pdf is a pdf file saved as ascii text with WebDNA>> embedded where dynamic values are to be transalated.>>>> I never was able to create a method for outputting dynamic pages, only>> values within the pages?>>>> Marc>=20> Hi Marc,>=20> Thanks so much for replying!> So let me clarify - are you saying that as soon as the number of pages ==20> of the pdf is greater than 1 then the source code of the pdf that lays ==20> outside those dynamic value "slots" needs to change to define the pdf =20> as having more than one page ... and no one we know is doing that =20> successfully with webdna such that we could see/edit such a pdf =20> template to then allow us to use the technique you mention above *when ==20> there is more than 1 and only 1 page*, ...right?> Gosh it would be nice to have knowledge of just that bit of the pdf =20> source so we could generate fully dynamic pdfs with webdna.>=20> Another Q:> The avery pdf template (like your co.pdf) from the webdna site =20> example neglects to write its contents past a few chars.. here see =20> this code from the example:> [writefile file=3DwrittenOnTheFly_pdfs/GovTest_avery.pdf&secure=3Df][UR=L]=20> [include file=3Davery_template.pdf&var=3Dvalue,etc...>=20> When I hit that code and then open the newly written file, that =20> written file is missing all but the first few chars of the pdf =20> template (what was supposed to be included by the [include =20> file=3Davery_template.pdf...] above).> Here is what *does* get written:> =C3=AF=C2=BB=C2=BF%PDF-1.1> %=C3=A2=E2=82=AC=C5=A1=C3=A2=E2=82=AC=C5=BE=C3=85=E2=80=9C=C3=A2=E2=82=AC==C2=9D>=20> and here is that same bit again, only url'ed to help me see what got =20> written:> %EF%BB%BF%25PDF-1.1%0A%25%E2%80%9A%E2%80%9E%C5%93%E2%80%9D%0A>=20> Why is everything past those chars missing? (There is 6k worth of data ==20> in the template.) (?)>=20> What are people doing to write pdfs on the fly? PHP? Or any good =20> (easy to instal/run) freeware/shareware out there.> All we need is Avery label #5160 dynamic pdfs, populated with our =20> webdna db data.>=20> -Govinda>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/> Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&categor=y=3D288> .>=20--=20-------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Associated Messages, from the most recent to the oldest:
Govinda,I too had the same problem at first, until I made use of the [raw][/raw]tags around everything (including line endings) that didn't need to beinterpreted by WebDNA.As far as number of pages goes, that is not exactly what I meant toconvey. What I meant was outputting a dynamic number of pages. Thisprocess will work fine if your pdf is more than one page, just don'texpect to output a pdf with n number of pages.Does that make sense?One other bad part of using this method is that once the pdf is made andconverted to ascii text, you cannot edit the pdf document. If you doneed to edit the pdf itself, you would have to completely rebuild theascii version and then re-add the WebDNA. I've done it and it's a pain..=.Having said that however, the pdfs I'm outputting have been inproduction now for more than 5 years without any hassle...MarcGovinda wrote:> rearranged for bottom posting.. see below:>=20>> Govinda wrote:>>> Hi All>>>>>> I am working to write PDFs on the fly with webdna (my first time with>>> this).>>> I thought I was in luck when I saw the sample on the webdna site>>> because it is said to be the exact PDF template I need (Avery labels>>> #5160).>>>>>> So far as far as I got is to see is that the sample (avery) I>>> downloaded from the webdna site seems contradictory in that it says>>> that it will choke on a null char (the readme says "should be ascii>>> only") and then in that Avery example it tries to include a file =20>>> (the>>> pdf template) which contains a null char! (Did the author test =20>>> this?!)>>> I do not know about the guts of a pdf to know how to go about =20>>> tweaking>>> the template to make it pure ascii (null char-free) and have it still>>> work as that real pdf (formatted for avery labels 5160).>>> The sample directions (readme.txt) say,>>> "Create a pdf file (I used Distiller for this demo)>>> in ASCII text format so there isn't any binary data>>> in the file (so null characters won't cause problems).">>>>>> The final pdf I want to write may have more than one page.>>>>>> I'd love to find success here to solve my own problem and also to>>> embellish the samples for the webdna site.>>>>>> It seems I need (at least) a sample pdf template (for the Avery =20>>> labels>>> #5160) which does not contain any binary data (null chars), right?>>> Can anyone give me some pointers?>>>>>> ------------>>> Govinda>>> govinda.webdnatalk@gmail.com>=20>> Govinda,>> I used the same approach several years ago using the example you =20>> site as>> a beginning approach. In my experience this method of creating a pdf>> on the fly is not a very good one, especially if you are in fact>> planning to output a dynamic number of pages.>> What that example is "OK" for is for outputting a basically static pdf>> file with dynamic values. You simply include WebDNA where you want =20>> your>> dynamic values to be populated right in the ascii text.>>>> To populate the pdf with the WebDNA values I used the following =20>> approach>> to write the file:>> [!]###### Write new PDF file for this order #######[/!]>> [writefile file=3Ddb/orders/[cart].pdf&secure=3Df][include>> file=3Dco.pdf[formvariables name=3D_&exact=3DF]&[getchars>> start=3D2][name][/getchars]=3D[url][value][/url][/=20>> formvariables=20>> ]&_Co_Num=20>> =3D[_Co_Num]&_Dept=3D[Dept]&Total_Price=3D[_Total_Price]&_cart=3D[cart=]][/=20>> writefile]>>>> The file named co.pdf is a pdf file saved as ascii text with WebDNA>> embedded where dynamic values are to be transalated.>>>> I never was able to create a method for outputting dynamic pages, only>> values within the pages?>>>> Marc>=20> Hi Marc,>=20> Thanks so much for replying!> So let me clarify - are you saying that as soon as the number of pages ==20> of the pdf is greater than 1 then the source code of the pdf that lays ==20> outside those dynamic value "slots" needs to change to define the pdf =20> as having more than one page ... and no one we know is doing that =20> successfully with webdna such that we could see/edit such a pdf =20> template to then allow us to use the technique you mention above *when ==20> there is more than 1 and only 1 page*, ...right?> Gosh it would be nice to have knowledge of just that bit of the pdf =20> source so we could generate fully dynamic pdfs with webdna.>=20> Another Q:> The avery pdf template (like your co.pdf) from the webdna site =20> example neglects to write its contents past a few chars.. here see =20> this code from the example:> [writefile file=3DwrittenOnTheFly_pdfs/GovTest_avery.pdf&secure=3Df][UR=L]=20> [include file=3Davery_template.pdf&var=3Dvalue,etc...>=20> When I hit that code and then open the newly written file, that =20> written file is missing all but the first few chars of the pdf =20> template (what was supposed to be included by the [include =20> file=3Davery_template.pdf...] above).> Here is what *does* get written:> =C3=AF=C2=BB=C2=BF%PDF-1.1> %=C3=A2=E2=82=AC=C5=A1=C3=A2=E2=82=AC=C5=BE=C3=85=E2=80=9C=C3=A2=E2=82=AC==C2=9D>=20> and here is that same bit again, only url'ed to help me see what got =20> written:> %EF%BB%BF%25PDF-1.1%0A%25%E2%80%9A%E2%80%9E%C5%93%E2%80%9D%0A>=20> Why is everything past those chars missing? (There is 6k worth of data ==20> in the template.) (?)>=20> What are people doing to write pdfs on the fly? PHP? Or any good =20> (easy to instal/run) freeware/shareware out there.> All we need is Avery label #5160 dynamic pdfs, populated with our =20> webdna db data.>=20> -Govinda>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> old archives: http://dev.webdna.us/TalkListArchive/> Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&categor=y=3D288> .>=20--=20-------------------------------------------Marc ThompsonSoftware EngineerOffice of Information TechnologyUniversity of Utah801.585.9264marc.thompson@utah.edu-------------------------------------------
Marc Thompson
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
F3 crashing server (1997)
bugs w/! &/or bad scripting??? (1997)
sandboxes with 6.0 (2004)
Converting native excel files (2001)
[OT] HTML Table Cell Problem (2003)
numeric sorting (2000)
SQL Server (2001)
[date format] w/in sendmail (1997)
Showing once on a founditems (1997)
Interpret twice? (1997)
Sorting LISTFILES (1997)
Need relative path explanation (1997)
Where is f2? (1997)
multi-paragraph fields (1997)
Security Tip (1996)
RE: Languages (1997)
[WebDNA] Server Speed/optomization (2009)
Decrypting a user password (2000)
Loosing Quantity (2000)
Mult-File Upload w/ Web Star (2000)