Link to home
Start Free TrialLog in
Avatar of Alex Bogdan
Alex Bogdan

asked on

VbCrLf not recognize in textbox

HI! I want to save to file PDF in VB6  many textbox. Some textbox are multiline but mjwPDF Not recognize VbCrLf.  Can you help me? The text in PDF created  apear on the same line, but in textbox is multiline
Avatar of Chris Watson
Chris Watson
Flag of United Kingdom of Great Britain and Northern Ireland image

Is the mjwPDF to which you refer, this?

If so, comment 6763 by Manila paper explains that multi-line support is not natively supported, but you can achieve it yourself. They provide an example (see the full comment, linked above, for the complete example):

It seems the reason is that by default objPDF will not overwrite a line that's already been written to. The solution is to tell objPDF to go down to the next line.

objPDF.PDFTextOut "This is the 1st line", 15, 1
objPDF.PDFTextOut "This is the 2nd line", 15, 2
objPDF.PDFTextOut "This is the 3rd line", 15, 3

The 2nd parameter "15" is the distance to the edge of the page. Our concern here is the 3rd param which is the line number, it increments by 1 line after every TextOut. You can now make a loop that increments the 3rd param after each objPDF.PDFTextOut.
Avatar of Alex Bogdan
Alex Bogdan

ASKER

Thanks a lot. I refer  at only one textbox with multiline. For exemple:
AAA
BBC
CCC
apear on textbox.
On the PDF file apear:
AAABBBCCC .
Not three line.
You will have to parse the textbox content yourself. For each line in the textbox, you will have to make a separate call to PDFTextOut(), keeping track of what line number you're writing to.
Make sure that the Multiline property is set to True
Sorry misread the question. Ignore the above.
How is the code?
How recognize each line? Can you write a litle exemple for my exemple?
Ican"t use VbCrLf?
In text is ON.  In OFF NOT WORKING. THanks a lot
What does "In text is ON.  In OFF NOT WORKING" mean?
ASKER CERTIFIED SOLUTION
Avatar of Chris Watson
Chris Watson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
THanks Chris! I have another quedtion. The text apears in pdf file not aligned. Not justify. O import from word document a text into rich text box in Vb6. When create pdf file, the text isn't the same as etc box.
Best  regards