How to convert text file(s) to PDF format?

195 views
Skip to first unread message

Dwa Grosze

unread,
Sep 13, 2011, 7:49:36 AM9/13/11
to
Hi,

The problem is as above. I searched all this group with various
keywords but didn't found any useful info. I'm new to xHb, so maybe
that's a reason too :) Some discussion on coverting pdf to txt I found
but none of them says sth like this: yoy got a function ... and so on.
Is there any function in xHB to do this or I'll have to try some other
way?

Thanks for help!

Regards

Maciej

Ella Stern

unread,
Sep 13, 2011, 8:40:09 AM9/13/11
to
Hello,


All document types have their own object models; a document type might
have more very different versions in time; operating systems might
offer different tools for supporting the generation or conversion
process.

Please define concretely you need(s):
- on which operating system(s) do you run the application you want to
output a PDF file
- do you want to generate a PDF file ( putting together the pieces of
the document page by page, detail by detail )
- do you want to convert an existing document ( .txt or other ) so to
output its PDF sibling

Ella

Otto Haldi

unread,
Sep 13, 2011, 10:58:57 AM9/13/11
to
A simple way to create PDF, is to make a print out to a PDF Printer driver.
Someting like PDF Creator. See: http://sourceforge.net/projects/pdfcreator

Regards
Otto

fatfat

unread,
Sep 13, 2011, 11:51:56 AM9/13/11
to
we are using pdfactivex.dll to create pdf within xharbour :)

"Dwa Grosze" 在郵件張貼內容主旨
cdc06f52-c642-48b2...@k12g2000vbd.googlegroups.com 中撰寫...

dlzc

unread,
Sep 13, 2011, 8:27:42 PM9/13/11
to
Dear Dwa Grosze:

On Sep 13, 4:49 am, Dwa Grosze <dwagros...@gmail.com> wrote:
...

How is the text file generated?

David A. Smith

dlzc

unread,
Sep 14, 2011, 12:56:56 PM9/14/11
to
I find the following methods exported in (an older copy of) PDFlib:
<QUOTE>
METHOD New( cFile, nLen, nHeigth, nWidth )
METHOD PdfNewPage( _cPageSize, _cPageOrient, _nLpi, _cFontName,
_nFontType, _nFontSize )
METHOD PdfClosePage()
METHOD PdfClose()
METHOD PdfPageSize( _cPageSize )
METHOD PdfPageOrient( _cPageOrient )
METHOD PdfSetLpi( _nLpi )
METHOD PdfSetFont( _cFont, _nType, _nSize, cId )
METHOD PdfDrawHeader()
METHOD PdfMargins( nTop, nLeft, nBottom )
METHOD PdfImageInfo( cFile )
METHOD PdfTiffInfo( cFile )

METHOD Pdfjpeginfo( cFile )
METHOD Pdfimage( cFile, nRow, nCol, nHeight, nWidth, cId,
Scalex, Scaley )
METHOD Pdfatsay( cString, nRow, nCol, lExact, cId )
METHOD Pdfgetfontinfo( cParam )
METHOD Pdfpagenum( n )

METHOD Getpagetype( nWidth, nHeight )
METHOD Settop( N ) INLINE ::aReport[ PDFTOP ] := N // top
METHOD Setleft( N ) INLINE ::aReport[ PDFLEFT ] := N // left &
right
METHOD Setbottom( N ) INLINE ::aReport[ PDFBOTTOM ] := N
METHOD Pdf_Rect( x, y, width, height )
METHOD Pdf_Stroke()
METHOD Setoverline( l )
METHOD Setunderline( l )
METHOD Pdfmoveto( X, Y )
METHOD Pdflineto( X, Y )
METHOD Pdfsetlinewidth( w )
METHOD Pdfsetlinecap( w )
METHOD Pdfsetdash( b, w )
METHOD Pdfsave( lBuf )
METHOD Pdfrestore( lBuf )
METHOD Pdfunder( Text, Len, X, Y )
METHOD Pdfover( Text, Len, x, y )
METHOD Pdf_Str_Width( Text, Len, Font, Size )
METHOD Pdfsetrgbcolor( R, G, B )
METHOD Pdfscale( X, Y, lBuf )
METHOD Pdftranslate( tX, tY )

METHOD Pdfpnginfo( cFile )
METHOD Pdfrotate( pHi )
METHOD Pdfclosepath()
METHOD Pdfendpath()

METHOD Pdfcurveto( x1, y1, x2, y2, x3, y3 )
METHOD Pdfcomplevel( x )
METHOD Pdfinfo( cTitle, cAuthor, cKey, cCreator )
METHOD PDF_setrgbcolor_fill( R, G, B )
<END QUOTE>

... so you might be able to generate the PDF with the formatting you
want, without making the text file first.

David A. Smith

Dwa Grosze

unread,
Sep 15, 2011, 5:44:30 AM9/15/11
to
On 13 Wrz, 14:40, Ella Stern <ella.st...@xharbour.com> wrote:
> Hello,
>
> All document types have their own object models; a document type might
> have more very different versions in time; operating systems might
> offer different tools for supporting the generation or conversion
> process.
>
> Please define concretely you need(s):
> - on which operating system(s) do you run the application you want to
> output a PDF file

MS Windows xp and above.

> - do you want to generate a PDF file ( putting together the pieces of
> the document page by page, detail by detail )

Those are flat text files and include control chars: CRLF, EndOfPage
(Just "eject" I suppose) and EndOfFile. They include polisch
dicriticatl chars (but it won't be any problem... I hope!)

> - do you want to convert an existing document ( .txt or other ) so to
> output its PDF sibling

Yes, yes, yes. I just have to "Save it as PDF".

>
> Ella

Thanks!

Dwa Grosze

unread,
Sep 15, 2011, 6:03:31 AM9/15/11
to
Thank You for such a hugh part of knowledge! I hope it'll help me in
my future xHB tasks. Now I just have to do something really simple. I
got a flat text file with control chars/marks like CRLF, eject and
EndOfFile and I just have to "save it as" pdf format. If *it* really
needs wider study and usage of the library You've mentioned I'll got
more work I thought in my most audacious presumptions...:(

Thanks!

Jayadev

unread,
Sep 15, 2011, 6:37:04 AM9/15/11
to
Dear Dwa Grosze,

Please see your private mail, I have sent you a txt2pdf.prg which I
generally use, you may have to modify it suitably to suit your environment.

HTH,

Warm regards,

Jayadev

"Dwa Grosze" <dwagr...@gmail.com> wrote in message
news:56001dd5-5d23-4278...@h6g2000yqe.googlegroups.com...

joreilly...@gmail.com

unread,
Oct 9, 2012, 6:08:10 PM10/9/12
to
Hi Jayadev.

Would you send me a txt2pdf.prg ?
Will be much appreciated.

Alex

rodrego sandino

unread,
Aug 5, 2021, 4:49:41 PMAug 5
to
hi my dear brother can you send this prg file for me please i urgently need it

rodrego sandino

unread,
Aug 5, 2021, 5:05:24 PMAug 5
to
On Thursday, September 15, 2011 at 6:37:04 PM UTC+8, Jayadev wrote:
> Dear Dwa Grosze,
>
> Please see your private mail, I have sent you a txt2pdf.prg which I
> generally use, you may have to modify it suitably to suit your environment.
> Please my dear brother please send this txt2pdf.prg to my email too vanda...@hotmail.com please i urgently need it.

rodrego sandino

unread,
Aug 6, 2021, 10:33:56 AMAug 6
to
i am still waiting you mister jayadev ....please send me the prg file of Txt2pdf program to my email vanda...@hotmail.com please hurry up.

Jayadev U

unread,
Aug 9, 2021, 12:04:22 AMAug 9
to
Hi,

Please check your email. Sorry for the delay in replying. I saw your
post just now.

Warm regards,

Jayadev

Reply all
Reply to author
Forward
0 new messages