Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Jan 05, 2017 6:16 pm

Is it possible at all to make any tables at all without borders? I have spent hours attempting this. No luck. Even if I use transparent pen or brush, still a nice fat black border between cells of the table. If I set the borders to be white and really thick I can make very skinny lines appear between the outer table and inner table but nothing else changes. This seems very dorky to me. Why do you have a border setting capability if it doesn't work? And how can a mature library go for years and years and years without this discovery? If I can't have no borders at all, then this library has no use to me at all.

perryway
 
Posts: 5
Joined: Wed Jan 04, 2017 7:42 pm

Fri Jan 06, 2017 3:41 am

Dear perryway,

Thanks for your inquiry.
Please try to use following code to achieve your target.
Code: Select all
            table.Style.BorderPen = new PdfPen(PdfBrushes.Transparent, 0f);
            table.Style.DefaultStyle.BorderPen = new PdfPen(PdfBrushes.Transparent, 0f);

If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 10, 2017 8:28 am

Dear perryway,

Did you test the code I provided ? Did it help you solve the issue ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 10, 2017 4:17 pm

Yes. It did. But now I have another set of problems. I am struggling trying to understand how your components work. Is there a help system where I can read what each object does, and get to understand the methods and properties? I need to make about 10 different PDF's, some of them will be single page ones, and I have no problem with those. Some involve tabular data and while I did make one that tabulates, I could not figure out how to do a simple header and footer with page number. The example you provided for headers draws the headers outside the page margins. I know what our printer's printable area is on a letter size paper and want to set the margins to that setting (.5" top and bottom, .25" sides). Then I want a header to take up the first n points, maybe 72, maybe more, and in there, I want our company logo, address and the title of the document on the right. I've already drawn those things I don't need to know how to draw the individual items, what I need to know is how to make the header size understood when the page is being rendered so that the table won't start printing on page 2 all the way on the very top of the page (like how it does now for me, with my limited understanding). The header should not go beyond the margins of the page. Is this possible?

perryway
 
Posts: 5
Joined: Wed Jan 04, 2017 7:42 pm

Wed Jan 11, 2017 3:41 am

Dear perryway,

Thanks for your feedback.
Here is Spire.PDF API for your kind reference.
https://www.e-iceblue.com/Tutorials/API/Spire.PDF.html
And this is the guide to add header.
https://www.e-iceblue.com/Tutorials/Spi ... B.NET.html
And the header is always in margin, if you want to change the header position/size, please change the parameter value in topSpace.Graphics.DrawString method accroding to your requirement.
If there is any question, please provide us the code you were using and the ideal result you want.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jan 11, 2017 4:51 pm

Thanks, I see how I missed the API documentation. I was confused by your website menu. Okay, I have figured out the header, footer, margin issue and have made multiple page documents with tabular data in a table. The last issue I have is I haven't figured out how to get some columns right aligned (currency values) and the rest left aligned, in the column headings. In the body of the tables the alignment works as desired. But the headings can only be made left aligned or right aligned for all headings. I have tried setting alignment manually, it's like it's being ignored.

Here's a snippet of my code where I draw the table:

Code: Select all
        // add the tabulated data
        y = y + 10;
        PdfTable table = new PdfTable();
        table.Style.BorderPen = _penTransparent;
        table.Style.CellPadding = 0;
        table.Style.CellSpacing = 0;
        table.Style.DefaultStyle.BorderPen = _penTransparent;
        table.Style.DefaultStyle.BackgroundBrush = PdfBrushes.White;
        table.Style.DefaultStyle.Font = _fontMain;
        table.Style.HeaderSource = PdfHeaderSource.ColumnCaptions;
        table.Style.HeaderStyle.BorderPen = _penTransparent;
        table.Style.HeaderStyle.BackgroundBrush = PdfBrushes.White;
        table.Style.HeaderStyle.Font = _fontMain;
        table.Style.HeaderStyle.StringFormat = _formatLeft;
        table.Style.ShowHeader = true;
        table.Style.RepeatHeader = true;
        table.BeginRowLayout += new BeginRowLayoutEventHandler(table_BeginRowLayout);
        table.DataSource = ds.Tables[2];
        table.Columns[0].Width = 10f;
        table.Columns[1].Width = 20f;
        table.Columns[2].Width = 30f;
        table.Columns[3].Width = 10f;
        table.Columns[4].Width = 10f;
        table.Columns[4].StringFormat = _formatRight;
        table.Columns[5].Width = 10f;
        table.Columns[5].StringFormat = _formatRight;
        table.Columns[6].Width = 10f;
        table.Columns[6].StringFormat = _formatRight;
        PdfTableLayoutFormat tableLayout = new PdfTableLayoutFormat();
        tableLayout.Break = PdfLayoutBreakType.FitElement;
        tableLayout.Layout = PdfLayoutType.Paginate;
        PdfLayoutResult result = table.Draw(page, new PointF(0, y), tableLayout);


I have tried commenting out
Code: Select all
table.Style.HeaderStyle.StringFormat = _formatLeft;
and the columns are still flush left, all of them. Am I overlooking something?

perryway
 
Posts: 5
Joined: Wed Jan 04, 2017 7:42 pm

Thu Jan 12, 2017 3:26 am

Dear perryway,

Thanks for the detailed information.
I have tested the code with the latest Spire.PDF Pack(Hot Fix) Version:3.8.121. The result is what you want, please check it on attachment. So please try to use this version.
Here is my entire code.
Code: Select all
            String[] data = {
   "PartNo;Description;OnHand;OnOrder;Cost;ListPrice",
   "900;Dive kayak;24;16;1356.75;3999.95"};
            String[][] dataSource = new String[data.Length][];
            for (int i = 0; i < data.Length; i++)
            {
                dataSource[i] = data[i].Split(';');
            }
            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add(PdfPageSize.A4);
            PdfTable table = new PdfTable();
            table.Style.CellPadding = 0;
            table.Style.CellSpacing = 0;
            table.Style.DefaultStyle.BackgroundBrush = PdfBrushes.White;
            table.Style.HeaderSource = PdfHeaderSource.ColumnCaptions;
            table.Style.HeaderStyle.BackgroundBrush = PdfBrushes.White;
            //if I comment out this line, the result is also correct
            table.Style.HeaderStyle.StringFormat = new PdfStringFormat(PdfTextAlignment.Left, PdfVerticalAlignment.Middle);
            table.Style.ShowHeader = true;
            table.Style.RepeatHeader = true;
            table.BeginRowLayout += table_BeginRowLayout;
            table.DataSource = dataSource;
            table.Columns[0].Width = 10f;
            table.Columns[1].Width = 20f;
            table.Columns[2].Width = 30f;
            table.Columns[3].Width = 10f;
            table.Columns[4].Width = 10f;
            table.Columns[4].StringFormat = new PdfStringFormat(PdfTextAlignment.Right, PdfVerticalAlignment.Middle);
            table.Columns[5].Width = 10f;
            table.Columns[5].StringFormat = new PdfStringFormat(PdfTextAlignment.Right, PdfVerticalAlignment.Middle);
            PdfTableLayoutFormat tableLayout = new PdfTableLayoutFormat();
            tableLayout.Break = PdfLayoutBreakType.FitElement;
            tableLayout.Layout = PdfLayoutType.Paginate;
            PdfLayoutResult result = table.Draw(page, new PointF(0, 20), tableLayout);
            doc.SaveToFile("TextAlignment9476.pdf");

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Jan 12, 2017 4:41 pm

I tested it and it does not work. Also, these .dll's are not with the free license. Even if they worked, it shows that red text. I am using the free PDF components. I have a number of PDF's I have to make. Not just tabulated data. If we have to purchase this in order to find out if it will do what we want, that won't work because what you provided doesn't work. Sorry.

perryway
 
Posts: 5
Joined: Wed Jan 04, 2017 7:42 pm

Fri Jan 13, 2017 2:13 am

Dear perryway,

Thanks for the information.
The free version has some function limitation, we suggest you use commecial version, and then test the code I provided with the version I mentioned. Don't warry about the red text, you can contact our sales team(sales@e-iceblue.com) to get a temporary license file for one month to remove the red text and have a better evaluation on our products.
If there still is issue with the latest version, please provide us a sample project for further investigation.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Jan 13, 2017 4:43 pm

Betsy.jiang wrote:The free version has some function limitation


By functions you mean it has bugs. Ones you don't want to fix because... well, it's free!

Betsy.jiang wrote:we suggest you use commecial version, and then test the code I provided with the version I mentioned.


I did that already. It does not work like you claimed it does. Like I stated above.

Betsy.jiang wrote:Don't warry about the red text, you can contact our sales team(sales@e-iceblue.com) to get a temporary license file for one month to remove the red text and have a better evaluation on our products.


In other words, snooker the customer with a free library that has bugs and you don't want to support, in order to convert them to paying customers. I'm sorry, if that's your routine method to gain paying customers, I don't support this method. You claimed to have a free library that had some functional limitation. The limits were within our specifications. I have invested over a week's effort into trying to get this stuff to work, and here I am reporting not one but several bugs in your software. And your response is I should become a paying customer. Well, if you don't have any pride of workmanship for your free library, what does that say? To me it doesn't look good. I believe I have been snookered.

Betsy.jiang wrote:If there still is issue with the latest version, please provide us a sample project for further investigation.


I have done that already. You can use the same spot of code I provided above where I set some columns with left justification and some with right and the headers are always either all left or all right and they do not follow the style of the columns like the rows of the table do. I downloaded your library, installed it, then tested it, saw the red text which made me feel like a sucker by the way, and then what happened after that? It didn't work! It still had the same bug.

Now I have another bug to report in the unsupported free version you don't have any pride of workmanship over. My next document I have created has a font problem. The first document comes out perfect! The second and all others thereafter are totally messed up. Fonts are incorrect on all subsequent executions. This being done on an aspx website. So I am thinking somewhere in your library it is not thread safe and there are resources that are not destroyed properly perhaps, and these are being used for subsequent document creations. For instance, the font I used for the page header for the big bold page title, that font gets used elsewhere in the document when in code I am using a totally different font.

So at this point I am very worried that your commercial version isn't worth the purchase because there's this huge huge bug here, this font issue. If someone can't control the fonts they use and their size, then there's no reason to use this library at all.

perryway
 
Posts: 5
Joined: Wed Jan 04, 2017 7:42 pm

Mon Jan 16, 2017 8:25 am

Dear perryway,

Sorry for late reply as weekend and thanks for the detailed information.
Did you test the code and check the result file(TextAlignment9476.pdf) I provided before ? It has six columns, and the style of some columns is left, and other is right. I think that is what you want. Maybe there is different code or other reason caused this issue. And here is my sample project for double checking.
http://www.e-iceblue.com/downloads/attachment/9476.zip
Could you please provide us your sample project ?

And for the font issue, did you test it with the latest version ? If the issue still exists, we will greatly appreciate if you can provide us the entire code you were using or a sample project. That would be very helpful to investigate this issue.

Sorry that currently we don't have the plan to maintain free version. But we will consider that if we have enough time. Hope for your understanding.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF