Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support


All forums · Statistics · Search ·

Two Pilots forum / For software developers / New Line Character
Author Message
karthik
# Posted: 4 Jun 2007 04:13


I am using "PDFCreatorPilot2" for generating PDF. my requirement is i have the following XML Structure:
<Root>
<parent>
<child1>child 1 content</child1>
<child2>child 2 content rn another line t some content rn end of line</child2>
<child3>child 3 content</child3>
<child4>child 4 content</child4>
</parent>
</Root>

I want to extract the content of <child2> element and display it in PDF. the extraction of content is successful and i kept it in string variable. when i pass this string variable to "PDFPAGE_TextOut" method of "piPDFDocumentClass" class. The PDF document was generated successfully. The problem is the content containing rn and t characters. The new line is not reflected into the generated PDF document. i have manually replace the string variable as: _strvariable.replace("rn",Environment.NewLine). but nothing works out.

can anyone help me how to resolve this problem.

Parse new line characters in PDF document.

The expected output in PDF:
child 2 content
another line some content
end of line

Thanks in advance...

Stanislav
Member
# Posted: 4 Jun 2007 06:13


Hello,

Please use function PDFPAGE_TextOutBox to output multiline text, for example:

PDF.PDFPAGE_TextOutBox 40, 40, 10, 100, 100, sText

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

karthik
# Posted: 4 Jun 2007 06:18


Thanks for the reply. how do i mention the width and height? for width can i use "PDF.PDFPAGE_GetTextWidth" and for height what should i do? that string variable may contain content upto 4 pages. so how do i mention the width and height? i cant mention as 100,100.

Regards,
Karthik

Stanislav
Member
# Posted: 4 Jun 2007 06:33


Hello,

The PDFPAGE_TextOutBox returns the count of characters in output, so you can call it with page width and height as a parameters instead of 100,100 and using returned value calculate remaining text length and continue output to next pages.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

karthik
# Posted: 4 Jun 2007 06:54


Thank you, i will be more happy if you could put example code.

Stanislav
Member
# Posted: 4 Jun 2007 09:42


Hello,

I've prepared example and sent it to developers for verification. When they'll contact me, i post it on the examples page and post link to the page here. Sorry for any inconvenience.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

karthik
# Posted: 4 Jun 2007 10:07


Thanks a lot. eagerly waiting for the URL.

karthik
# Posted: 5 Jun 2007 04:12


Have you prepared the example and posted it?

what i did in my program is:
my data is stored in this string variable: _data;

int _count = 1;

while (_count > 0)
{
_count = PDF.PDFPAGE_TextOutBox(20, 20, 15, _data.Length, 750, _data);
if (_count > 0)
{
PDF.NewPage();
_data = _data.Substring(_count);
}
}

The above code generating PDF with new line characters but the characters are not placed in order. when i copy the value of string variable and put it in notepad it is displaying properly or when i try to view the content of the variable by clicking on Text Visualizer in Visualstudio.NET 2005 it is displaying properly. but in PDF i am not able to see that result (displayed inappropriately).

could you tell me whatz wrong with my code

Stanislav
Member
# Posted: 5 Jun 2007 04:52


Hello,

Yes, i've prepared it, but developers need to fix issue in the library code to allow example to work correctly. Sorry for any inconvenience.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

karthik
# Posted: 7 Jun 2007 10:02


Dear Stanislav

I understand you have prepared the example and the developers need to fix it. I am the registered user. Is it possible for me to get an assistance for this issue by e-mail/phone.

Regards,
Karthik.

Stanislav
Member
# Posted: 7 Jun 2007 13:17


Hello,

This example is in our developers. While i prepare it, i've found a bug. It'll be fixed soon. When it'll be fixed and new version of the library will be available, example will be posted.

Best regards,
Stanislav
Two Pilots
www.colorpilot.com

 

 

Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013

 

Page top