Skip to content

Commit 1afc371

Browse files
Add new test case for SAC# 47946
1 parent 6a15939 commit 1afc371

File tree

7 files changed

+966
-1
lines changed

7 files changed

+966
-1
lines changed

dotnet/test/DotNetPdfTest/DotNetPDFUnitTest.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
<None Update="appsettings.json">
4646
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4747
</None>
48+
<None Update="PDFReport.ini">
49+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
50+
</None>
4851
</ItemGroup>
4952

5053
</Project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
SearchNewFontsOnce= true
2+
Leading= 2
3+
RunDirection= 2
4+
DashedStyle= 4;2
5+
TopMargin= 0.75
6+
AdjustToPaper= true
7+
LeftMargin= 0.75
8+
DEBUG= false
9+
ServerPrinting= false
10+
Embeed Fonts= true
11+
Version= 1.0.0.0
12+
BottomMargin= 6
13+
LongDashedStyle= 6;2
14+
EmbeedNotSpecifiedFonts= false
15+
Barcode128AsImage= true
16+
MarginsInsideBorder= false
17+
OutputFileDirectory= .
18+
LineCapProjectingSquare= true
19+
DottedStyle= 1;2
20+
JustifiedTypeAll= false
21+
SearchNewFonts= false
22+
LongDotDashedStyle= 6;2;1;2
23+
24+
[Fonts Location (Sun)]
25+
Microsoft Sans Serif= c:\windows\fonts\micross.ttf
26+
Microsoft Sans Serif,Bold= c:\windows\fonts\micross.ttf
27+
Verdana= c:\windows\fonts\verdana.ttf
28+
29+
[Embeed Fonts]
30+
Verdana= true

dotnet/test/DotNetPdfTest/PDFTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ public void TestITextFormat()
1717
File.Delete(report);
1818
try
1919
{
20-
apdfformat test = new apdfformat();
20+
apdfformats2 test = new apdfformats2();
2121
test.execute();
22+
23+
longHtml test2 = new longHtml();
24+
test2.execute();
2225
}
2326
#pragma warning disable CA1031 // Do not catch general exception types
2427
catch (Exception ex)
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
using GeneXus.Application;
2+
using GeneXus.Data.NTier;
3+
using GeneXus.Http.Server;
4+
using GeneXus.Procedure;
5+
using GeneXus.Utils;
6+
namespace GeneXus.Programs
7+
{
8+
public class adatos : GXProcedure
9+
{
10+
public int executeCmdLine( string[] args )
11+
{
12+
return ExecuteCmdLine(args); ;
13+
}
14+
15+
protected override int ExecuteCmdLine( string[] args )
16+
{
17+
string aP0_staticDir = new string(' ',0) ;
18+
GXBaseCollection<SdtFCKTstCollection_FCKTst> aP1_Gxm2rootcol = new GXBaseCollection<SdtFCKTstCollection_FCKTst>() ;
19+
if ( 0 < args.Length )
20+
{
21+
aP0_staticDir=((string)(args[0]));
22+
}
23+
else
24+
{
25+
aP0_staticDir="";
26+
}
27+
execute(aP0_staticDir, out aP1_Gxm2rootcol);
28+
return GX.GXRuntime.ExitCode ;
29+
}
30+
31+
public adatos( )
32+
{
33+
context = new GxContext( );
34+
DataStoreUtil.LoadDataStores( context);
35+
IsMain = true;
36+
context.SetDefaultTheme("Carmine", false);
37+
}
38+
39+
public adatos( IGxContext context )
40+
{
41+
this.context = context;
42+
IsMain = false;
43+
}
44+
45+
public void execute( string aP0_staticDir ,
46+
out GXBaseCollection<SdtFCKTstCollection_FCKTst> aP1_Gxm2rootcol )
47+
{
48+
this.AV6staticDir = aP0_staticDir;
49+
this.Gxm2rootcol = new GXBaseCollection<SdtFCKTstCollection_FCKTst>( context, "FCKTst", "TestReportes") ;
50+
initialize();
51+
ExecutePrivate();
52+
aP1_Gxm2rootcol=this.Gxm2rootcol;
53+
}
54+
55+
public GXBaseCollection<SdtFCKTstCollection_FCKTst> executeUdp( string aP0_staticDir )
56+
{
57+
execute(aP0_staticDir, out aP1_Gxm2rootcol);
58+
return Gxm2rootcol ;
59+
}
60+
61+
public void executeSubmit( string aP0_staticDir ,
62+
out GXBaseCollection<SdtFCKTstCollection_FCKTst> aP1_Gxm2rootcol )
63+
{
64+
this.AV6staticDir = aP0_staticDir;
65+
this.Gxm2rootcol = new GXBaseCollection<SdtFCKTstCollection_FCKTst>( context, "FCKTst", "TestReportes") ;
66+
SubmitImpl();
67+
aP1_Gxm2rootcol=this.Gxm2rootcol;
68+
}
69+
70+
protected override void ExecutePrivate( )
71+
{
72+
/* GeneXus formulas */
73+
/* Output device settings */
74+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
75+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
76+
Gxm1fcktstcollection.gxTpr_Fcktstid = 1;
77+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "tabla basica";
78+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width: 500px;\"> <caption>Tabla basica</caption><thead><tr>"+"<th scope=\"col\"><span style=\"color: red;\">row 1 cell 1 bold rojo</span></th><th scope=\"col\"><span style=\"color: blue;\">row1 cell 2 bold azul</span></th>"+"</tr></thead><tbody><tr><td>row 2 cell 1</td><td>row2 cell 2</td></tr><tr> <td>row 3 cell 1</td><td>row 3 cell 2</td></tr></tbody>"+"</table><p>&nbsp;</p>";
79+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 1;
80+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
81+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
82+
Gxm1fcktstcollection.gxTpr_Fcktstid = 2;
83+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "lista de elementos";
84+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<ol><li>Coffee</li><li>Milk</li></ol>";
85+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 2;
86+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
87+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
88+
Gxm1fcktstcollection.gxTpr_Fcktstid = 3;
89+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "parrafos";
90+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<p>This is a paragraph 1<p>This is a paragraph 2";
91+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 3;
92+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
93+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
94+
Gxm1fcktstcollection.gxTpr_Fcktstid = 4;
95+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "link";
96+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<a href=\"http://www.w3schools.com/\">Visit W3Schools</a>";
97+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 4;
98+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
99+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
100+
Gxm1fcktstcollection.gxTpr_Fcktstid = 5;
101+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "imagen";
102+
Gxm1fcktstcollection.gxTpr_Fcktstfck = StringUtil.Format( "<img src=\"%1%2Resources/w3schools.jpg\" width=\"52\" height=\"71\" />", AV5Httprequest.BaseURL, AV6staticDir, "", "", "", "", "", "", "");
103+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 5;
104+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
105+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
106+
Gxm1fcktstcollection.gxTpr_Fcktstid = 6;
107+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "horizontal rule";
108+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<html><body><p>The hr tag defines a horizontal rule:</p><hr /><p>This is a paragraph</p><hr /><p>This is a paragraph</p>"+"<hr /><p>This is a paragraph</p></body></html>";
109+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 6;
110+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
111+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
112+
Gxm1fcktstcollection.gxTpr_Fcktstid = 7;
113+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "fonts";
114+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<html><body><h1 style=\"font-family:verdana;\">A heading</h1><p style=\"font-family:arial;color:red;font-size:20px;\">A paragraph.</p>"+"</body></html>";
115+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 7;
116+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
117+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
118+
Gxm1fcktstcollection.gxTpr_Fcktstid = 8;
119+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "nested lists";
120+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<html><body><h4>A nested List:</h4><ul> <li>Coffee</li> <li>Tea <ul> <li>Black tea</li> <li>Green tea"+" <ul> <li>China</li> <li>Africa</li> </ul> </li> </ul> </li> <li>Milk</li></ul></body></html>";
121+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 8;
122+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
123+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
124+
Gxm1fcktstcollection.gxTpr_Fcktstid = 9;
125+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "radio buttons";
126+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<html><body><form action=\"\"><input type=\"radio\" name=\"sex\" value=\"male\" /> Male<br /><input type=\"radio\" name=\"sex\" value=\"female\" /> Female"+"<input type=\"checkbox\" name=\"vehicle\" value=\"Bike\" /> I have a bike<br /><input type=\"checkbox\" name=\"vehicle\" value=\"Car\" /> I have a car </form>"+"</body></html>";
127+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 9;
128+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
129+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
130+
Gxm1fcktstcollection.gxTpr_Fcktstid = 10;
131+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "color en texto parag";
132+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<h1 style=\"font-family:verdana;\">A heading</h1><p style=\"font-family:verdana;font-size:12px;color:green\">"+"This is a paragraph with some text in it. This is a paragraph with some text in it. This is a paragraph with some text in it. This is a paragraph with some text in it.</p>";
133+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 10;
134+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
135+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
136+
Gxm1fcktstcollection.gxTpr_Fcktstid = 12;
137+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "mail to con link";
138+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<p>This is another mailto link:<a href=\"mailto:someone@example.com?cc=someoneelse@example.com&bcc=andsomeoneelse@example.com&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!\">Send mail!</a></p>";
139+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 12;
140+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
141+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
142+
Gxm1fcktstcollection.gxTpr_Fcktstid = 13;
143+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "table borders";
144+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<html><body><h4>With a normal border:</h4> <table border=\"1\"><tr> <td>First</td> <td>Row</td></tr> <tr>"+"<td>Second</td> <td>Row</td></tr></table><h4>With a thick border:</h4> <table border=\"8\"><tr> <td>First</td> <td>Row</td>"+"</tr> <tr> <td>Second</td> <td>Row</td></tr></table><h4>With a very thick border:</h4> <table border=\"15\"><tr> <td>First</td>"+"<td>Row</td></tr> <tr> <td>Second</td> <td>Row</td></tr></table></body></html>";
145+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 13;
146+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
147+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
148+
Gxm1fcktstcollection.gxTpr_Fcktstid = 14;
149+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "espacios";
150+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; espacios &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;en blanco &nbsp; &nbsp; fin</p>";
151+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 14;
152+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
153+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
154+
Gxm1fcktstcollection.gxTpr_Fcktstid = 15;
155+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "color rgb";
156+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<p> <span>test </span></p><p> <strong><span style=\"color:#ff0000;\">test sin span</span></strong></p>";
157+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 15;
158+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
159+
Gxm2rootcol.Add(Gxm1fcktstcollection, 0);
160+
Gxm1fcktstcollection.gxTpr_Fcktstid = 16;
161+
Gxm1fcktstcollection.gxTpr_Fcktstdsc = "Test centralizado";
162+
Gxm1fcktstcollection.gxTpr_Fcktstfck = "<h1 style=\"text-align:center\">Teste de centralizado</h1> <p style=\"text-align:right\">A direita</p> <p>Esquerda</p>";
163+
Gxm1fcktstcollection.gxTpr_Fcktstotro = 15;
164+
this.cleanup();
165+
}
166+
167+
public override void cleanup( )
168+
{
169+
CloseCursors();
170+
if ( IsMain )
171+
{
172+
context.CloseConnections();
173+
}
174+
ExitApp();
175+
}
176+
177+
public override void initialize( )
178+
{
179+
Gxm1fcktstcollection = new SdtFCKTstCollection_FCKTst(context);
180+
AV5Httprequest = new GxHttpRequest( context);
181+
/* GeneXus formulas. */
182+
}
183+
184+
private string AV6staticDir ;
185+
private GXBaseCollection<SdtFCKTstCollection_FCKTst> aP1_Gxm2rootcol ;
186+
private GxHttpRequest AV5Httprequest ;
187+
private GXBaseCollection<SdtFCKTstCollection_FCKTst> Gxm2rootcol ;
188+
private SdtFCKTstCollection_FCKTst Gxm1fcktstcollection ;
189+
}
190+
191+
}

0 commit comments

Comments
 (0)