Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: Relationship DataTable and DataReader ? Pin
PIEBALDconsult29-Sep-14 18:09
mvePIEBALDconsult29-Sep-14 18:09 
QuestionC# .net Pin
abdul rafi29-Sep-14 1:57
abdul rafi29-Sep-14 1:57 
AnswerRe: C# .net Pin
Eddy Vluggen29-Sep-14 2:18
professionalEddy Vluggen29-Sep-14 2:18 
AnswerRe: C# .net Pin
BillWoodruff29-Sep-14 3:14
professionalBillWoodruff29-Sep-14 3:14 
QuestionWPF and HTML Rendering Pin
upksinghm29-Sep-14 1:55
upksinghm29-Sep-14 1:55 
AnswerRe: WPF and HTML Rendering Pin
Eddy Vluggen29-Sep-14 2:15
professionalEddy Vluggen29-Sep-14 2:15 
GeneralRe: WPF and HTML Rendering Pin
upksinghm9-Oct-14 22:56
upksinghm9-Oct-14 22:56 
QuestionData missing on Adobe Reader IX Pin
ZhangJunjun28-Sep-14 21:22
ZhangJunjun28-Sep-14 21:22 
Hi,

I generated a table using the library, but the data didn't show on Adobe Reader IX, it works fine if using other PDF reader or view via URL.

Could anyone know what's the problem?

Thanks in advance.

Eileen

Here is my code:

C#
private void DrawInvoiceItemsTable(PdfContents contents, Invoice invoice)
        {
            contents.SaveGraphicsState();
            contents.Translate(0, 0);
            const double col1X = 2.2;
            const double baseY = 19.25;
            const double col2X = 11.1;
            const double col5X = 16;
            contents.SetColorNonStroking(Color.FromArgb(40, 171, 226));
            contents.DrawRectangle(1.9, 19, 8.5, 0.8, PaintOp.Fill);
            contents.DrawText(ArialBold, 10.0, col1X, baseY, TextJustify.Left, DrawStyle.Normal, Color.White, "ITEM DESCRIPTION");
            contents.DrawRectangle(10.45, 19, 4.2, 0.8, PaintOp.Fill);
            contents.DrawText(ArialBold, 10.0, col2X, baseY, TextJustify.Left, DrawStyle.Normal, Color.White, "POINTS ISSUED");
            contents.DrawRectangle(14.7, 19, 5.5, 0.8, PaintOp.Fill);
            contents.DrawText(ArialBold, 10.0, col5X, baseY, TextJustify.Left, DrawStyle.Normal, Color.White, "TOTAL AMOUNT");
            contents.RestoreGraphicsState();

            var box = new TextBox(7.9);
            var posY = 18.6;
            const double fontSize = 9.0;
            var lineSpace = ArialNormal.LineSpacing(fontSize);
            var decent = ArialNormal.Descent(fontSize);
            const double lineHeight = 0.3;
            contents.SaveGraphicsState();
            contents.Translate(0, 0);
            for (var i = 0; i < invoice.InvoiceCharges.Count; i++)
            {
                box.Clear();
                if (i % 2 != 0)
                {
                    contents.SetColorNonStroking(Color.FromArgb(230, 230, 230));
                    contents.DrawRectangle(1.9, posY - lineSpace * 1.5, 8.5, lineHeight + lineSpace, PaintOp.Fill);
                    contents.DrawRectangle(10.45, posY - lineSpace * 1.5, 4.2, lineHeight + lineSpace, PaintOp.Fill);
                    //contents.DrawRectangle(12.6, PosY - lineSpace * 1.5, 2.1, lineHeight + lineSpace, PaintOp.Fill);
                    contents.DrawRectangle(14.7, posY - lineSpace * 1.5, 5.5, lineHeight + lineSpace, PaintOp.Fill);
                    //contents.DrawRectangle(16.9, PosY - lineSpace * 1.5, 3, lineHeight + lineSpace, PaintOp.Fill);
                }
                box.AddText(ArialNormal, fontSize, Color.FromArgb(85, 86, 89), invoice.InvoiceCharges[i].Description);
                contents.DrawText(col1X, ref posY, 0, 0, box);
                posY += decent;
                contents.DrawText(ArialNormal, fontSize, col2X, posY, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), invoice.InvoiceCharges[i].PointsIssued);
                //contents.DrawText(ArialNormal, fontSize, col3X, PosY, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), invoice.InvoiceCharges[i].Amount.ToString("c2"));
                //contents.DrawText(ArialNormal, fontSize, col4X, PosY, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), invoice.InvoiceCharges[i].GstRate.ToString("n2"));
                contents.DrawText(ArialNormal, fontSize, col5X, posY, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), invoice.InvoiceCharges[i].Amount.ToString("c2"));

                posY -= decent + lineSpace;
            }
            contents.DrawText(ArialNormal, 10.0, 15.2, 6.5, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), "Subtotal");
            contents.DrawText(ArialNormal, 10.0, 19, 6.5, TextJustify.Right, DrawStyle.Normal, Color.Black, invoice.SubTotal.ToString("c2"));
            contents.DrawText(ArialNormal, 10.0, 15.2, 6, TextJustify.Left, DrawStyle.Normal, Color.FromArgb(85, 86, 89), "GST");
            contents.DrawText(ArialNormal, 10.0, 19, 6, TextJustify.Right, DrawStyle.Normal, Color.Black, invoice.GstTotal.ToString("c2"));
            contents.SetColorNonStroking(Color.FromArgb(40, 171, 226));
            contents.DrawRectangle(14.75, 5, 2.1, 0.8, PaintOp.Fill);
            contents.DrawRectangle(16.9, 5, 3, 0.8, PaintOp.Fill);
            contents.DrawText(ArialBold, 10.0, 15.2, 5.25, TextJustify.Left, DrawStyle.Normal, Color.White, "TOTAL");
            contents.DrawText(ArialBold, 10.0, 18.5, 5.25, TextJustify.Center, DrawStyle.Normal, Color.White, invoice.TotalAmount.ToString("c2"));
        }

QuestionRe: Data missing on Adobe Reader IX Pin
Eddy Vluggen29-Sep-14 3:03
professionalEddy Vluggen29-Sep-14 3:03 
Questionhow to check vaild email address? Pin
ATHIRA S28-Sep-14 20:21
ATHIRA S28-Sep-14 20:21 
AnswerRe: how to check vaild email address? Pin
BillWoodruff28-Sep-14 20:37
professionalBillWoodruff28-Sep-14 20:37 
SuggestionRe: how to check vaild email address? Pin
Kornfeld Eliyahu Peter28-Sep-14 21:01
professionalKornfeld Eliyahu Peter28-Sep-14 21:01 
AnswerRe: how to check vaild email address? Pin
Bernhard Hiller28-Sep-14 22:03
Bernhard Hiller28-Sep-14 22:03 
GeneralRe: how to check vaild email address? Pin
Pete O'Hanlon28-Sep-14 22:15
mvePete O'Hanlon28-Sep-14 22:15 
GeneralRe: how to check vaild email address? Pin
Richard Deeming29-Sep-14 1:42
mveRichard Deeming29-Sep-14 1:42 
AnswerRe: how to check vaild email address? Pin
jschell29-Sep-14 7:49
jschell29-Sep-14 7:49 
Questioninvoke method in derived classes vs. invoke method in base class: C# language question Pin
BillWoodruff27-Sep-14 21:56
professionalBillWoodruff27-Sep-14 21:56 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter27-Sep-14 22:47
professionalKornfeld Eliyahu Peter27-Sep-14 22:47 
GeneralRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
BillWoodruff27-Sep-14 23:44
professionalBillWoodruff27-Sep-14 23:44 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter27-Sep-14 23:55
professionalKornfeld Eliyahu Peter27-Sep-14 23:55 
GeneralRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Richard Deeming29-Sep-14 1:40
mveRichard Deeming29-Sep-14 1:40 
AnswerRe: invoke method in derived classes vs. invoke method in base class: C# language question Pin
Kornfeld Eliyahu Peter29-Sep-14 2:06
professionalKornfeld Eliyahu Peter29-Sep-14 2:06 
Questionexecuting multiple sql select queries in ms access using c# Pin
nishadamit9027-Sep-14 21:32
nishadamit9027-Sep-14 21:32 
QuestionXSD question... Pin
SledgeHammer0126-Sep-14 15:41
SledgeHammer0126-Sep-14 15:41 
QuestionRe: XSD question... Pin
Richard MacCutchan26-Sep-14 21:37
mveRichard MacCutchan26-Sep-14 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.