Inspired by Beth Massi's excellent blog[^] post on generating Excel data using
an XML literal:
I am trying to generate XPS documents the same way.
The code I have is:-
Public Function SeatingAppointmentPage(ByVal ClientName As String, _<br />
ByVal Address1 As String, _<br />
ByVal Address2 As String, _<br />
ByVal Address3 As String, _<br />
ByVal Address4 As String, _<br />
ByVal AppointmentDate As Date, _<br />
ByVal Signatory As String) As <br />
XElement<br />
<br />
Dim _seatingAppointmentPage As XElement = <FixedPage Width="816" <br />
Height="1056" xmlns="http://schemas.microsoft.com/xps/2005/06" <br />
xml:lang="und"><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="166.56" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="185.44" <br />
Indices="94;8,88;49;68;80,90;72;8,88;96;3;3" UnicodeString=<%= ClientName <br />
%>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="204.32" <br />
Indices="94;8,88;36,69;71;71;85;72;86,57;86;3;20;8;96;3" UnicodeString=<%= <br />
Address1 %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="223.2" <br />
Indices="94;8,88;36,69;71;71;85;72;86,57;86;21;8;96;3" UnicodeString=<%= <br />
Address2 %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="242.08" <br />
Indices="94;8,88;36,69;71;71;85;72;86,57;86;3;22;8;96;3" UnicodeString=<%= <br />
Address3 %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="260.96" <br />
Indices="94;8,88;36,69;71;71;85;72;86,57;86;3;23;8;96;3" UnicodeString=<%= <br />
Address4 %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="279.84" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="298.72" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="317.6" Indices="94;8,88;39;68;87;72;8;96;3" <br />
UnicodeString=<%= Date.Now %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="336.48" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="355.36" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="374.24" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="393.12" <br />
Indices="39;72;68;85,40;3;94;8,88;49;68;80;72;8;96;3;3" UnicodeString=<%= <br />
"Dear " & ClientName %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="411.52" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="429.92" <br />
Indices="36;81;3,29;68;83;83,57;82;76;81;87;80,85;72;81;87;3,29;75;68;86;3;69,57;72;72;81,57;3;68;85;85;68;81;74,55;72,57;71;3;73,29;82;85,34;3;92,49;82;88;3,29;87;82;3;86,51;72;72;3,29;94;8,88;48;72;80,85;69;72;85;3;50;73,29;3,29;54;87;68;73,30;73,29;8;96;3,27;68;87,29;3" <br />
UnicodeString="An appointment has been arranged for you to see {%Member Of <br />
Staff%} at "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="457.6" <br />
Indices="40;53;51;48,84;182;86,49;3;54,68;72;68;87,29;76;81,55;74;3;56;81;76;87;3;76,23;81;3;54;68,57;81;71;92,49;80,85;82;88;81;87,29;3;82;81;29,29;3" <br />
UnicodeString="ERPM's Seating Unit in Sandymount on: "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="485.76" Indices="3,301;3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ffff0000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="247.2" OriginY="485.76" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ffff0000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="514.08" Indices="3,301;3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="247.2" OriginY="514.08" <br />
Indices="94;8,88;36,69;83;83;82;76;81;87;80;72;81,62;87;3,27;39;68;87,34;72;8,88;96;3" <br />
UnicodeString=<%= AppointmentDate %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="542.4" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="199.2" OriginY="542.4" Indices="3,301;3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="570.24" <br />
Indices="38;68;81;3,29;92,49;82;88;3,29;83;79;72;68;86,51;72;3;87;72;79,23;72;83;75,57;82;81;72,57;3;80,84;72;3;87,29;82;3;70;82;81,57;73,29;76;85;80;3;87;75;76,23;86;3;68;83;83,57;82;76;81;87;80,85;72;81;87,29;17;3" <br />
UnicodeString="Can you please telephone me to confirm this appointment. "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="597.92" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="625.6" <br />
Indices="56;81;71;72,57;85;3,27;87;75,57;72;3;43;72;68,57;79;87,27;75,57;3;9;3;54;68,57;73,29;72;87;92,49;3,29;51;85;82;70;72;71;88,57;85;72;86;15;3;90,71;72,57;3;81;82;90;3,27;85;72;84;88;72;86,51;87;3;87;75;68,57;87;3;68;79,23;79;3;70;75;68;76;85;86;3;68;85,34;72;3" <br />
UnicodeString="Under the Health & Safety Procedures, we now request that <br />
all chairs are "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="653.28" <br />
Indices="70;79;72;68;81,57;72;71;3;83,57;85;76,21;82,57;85;3,27;87;82,57;3;68;86;86;72;86,51;86;80,84;72;81;87,29;3;18;3;73,29;76;87;87,29;76;81,55;74,55;15,29;3;68;86;3;90;82,55;85;78;3;70;68;81,57;81;82;87;3,29;69;72;3,29;70;68;85;85;76,21;72;71,57;3;82;88,57;87;3;82;81;3,29;71;76;85;87;92,49;3" <br />
UnicodeString="cleaned prior to assessment / fitting, as work cannot be <br />
carried out on dirty "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="680.96" <br />
Indices="70;75;68;76,23;85;86;17;3;3;3;58,100;72;3;90,71;82;88,57;79;71;3;69;72,57;3;74,55;85;68;87;72;73,30;88;79;3;76;73,29;3;92,49;82;88,57;3;90,71;82;88,57;79;71,55;3,29;70;82;80,84;83;79,23;92,49;3;90,71;76;87;75;3;87,29;75;76;86;3;85;72;84,55;88;72,57;86;87;17;3" <br />
UnicodeString="chairs. We would be grateful if you would comply with this <br />
request. "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="708.64" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="736.8" <br />
Indices="60,66;82;88;85;86;3;86,57;76;81;70;72;85,40;72;79;92,53;15;3" <br />
UnicodeString="Yours sincerely, "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="755.68" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="774.56" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="793.44" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="812.32" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="831.2" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="850.08" Indices="3" UnicodeString=" "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="868.96" <br />
Indices="66;66;66,57;66;66;66,57;66;66;66,57;66;66;66,57;66;66;66;66,57;66;66;66,57;66;3" <br />
UnicodeString="____________________ "/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="887.84" <br />
Indices="94;8,88;54;76,29;74;81;68;87;82;85;92,53;8,88;96;3" <br />
UnicodeString=<%= Signatory %>/><br />
<Glyphs <br />
Fill="#ff000000" FontRenderingEmSize="15.9697" StyleSimulations="None" <br />
OriginX="151.2" OriginY="906.72" Indices="3" UnicodeString=" "/><br />
</FixedPage><br />
<br />
Return _seatingAppointmentPage<br />
End Function
However I'd like to turn this into a function that returns a
System.Windows.Documents.FixedPage instead of an XElement - any ideas?
|