Trådstart#1
Håller på med lite gammalt skräp
Har en textfil som läses in och med hjälp av abcpdf skapas ett pdf dokument.
Men formateringen ifrån textfilen försvinner när pdf dokumentet skapas.
private void addText()
{
string s = "";
Doc theDoc = new Doc();
double w = theDoc.MediaBox.Width;
double h = theDoc.MediaBox.Height;
double l = theDoc.MediaBox.Left;
double b = theDoc.MediaBox.Bottom;
theDoc.Transform.Rotate(90, l, b);
theDoc.Transform.Translate(w, 0);
// rotate our rectangle
theDoc.Rect.Width = h;
theDoc.Rect.Height = w;
//theDoc.Width = 4;
theDoc.Rect.Inset(20, 20);
theDoc.Font = theDoc.AddFont("Arial");
theDoc.FontSize = 8;
theDoc.TextStyle.Justification = 1;
theDoc.Color.String = "255 0 0";
theDoc.VPos = 0;
theDoc.HPos = 0.5;
using (TextReader rd = new StreamReader("C:\\PDF\\temp.txt", System.Text.Encoding.Default , false))
{
while ((s = rd.ReadLine()) != null)
{
s += "\r\n";
theDoc.AddText(s);
}
}
theDoc.Save("C:\\PDF\\test2.pdf");
theDoc.Clear();
}
Någon med nån bra idé... Har totalt hjärnsläpp idag verkar det som
