|
this is the format I am looking for my report generation.
diligent hands rule....
|
|
|
|
|
Hello,
Thank you for making my work easier with this library. I want small addtion to this . I am using telugu text to generate the PDf. but it is only displaying ???????. may be unicode is not supported in this library. Please try to add unicode support
Veda Reddy
|
|
|
|
|
|
|
Hi Paolo,
Your library is awesome, but i have been facing an issue recently. The PDF files are not opening in the Windows 8 Metro PDF reader.
Any ideas?
|
|
|
|
|
Hello,
this is known problem.
obviously here many bugs in the library, I have worked with this library since many years, wrote a lot of extensions and fixes, therefore I can't publish new code here. Moreover, I've asked the originator to work together, update code and post here, but sad to say, I get no answer and no support for problems.
First big problem, as many and me mentioned here, is bug in XREF-Table, many authors posted solution, all solutions are results in the same PDF-fix. Choose one of them.
Second big problem, nobody mentioned here, is if you set dokument header - at creation time the header will be created and added to object list and if You set a header, NEW header with new parameters will be created and added, not the old one will be updated. This results in bad object serialization at the time of SaveDocument(). The fix is really easy, if new header data should be set, the old object should be used!
Here ist the fix:
public void SetHeaders(string subject, string title, string author, string keywords)
{
if (subject == null) throw new Exception("string Subject cannot be null.");
if (title == null) throw new Exception("string Title cannot be null.");
PdfHeader header = this.Header as PdfHeader;
header.subject = subject;
header.title = title;
header.author = author;
header.keywords = keywords;
}
After both fixes (maybe already only header-fix) this should (I can't guarantee this, I have my private version) be opened in the Windows 8 Metro PDF reader.
Cu,
Alex
|
|
|
|
|
To all, reading my previous answer:
If you wonder about compiler errors, here is nothing to wonder, just change following line of code of PdfHeader class inside PdfHeader.cs:
internal string subject,title,author,creationdate, keywords;
Alex
|
|
|
|
|
Dear Paolo Gios
Thanks u have give a great library..
Can you please extend this to read a pdf & get content including styles & table format.
I need to extract Tables from Pdf document.
I have searched your Website there no link to open new thread so i have come back here to write to u.
Please check & Update asap.
Thanks In Advance..
|
|
|
|
|
Hi, I can't find a copi of "Gios Pdf.NET.dll". Can someone send me it?
Thanks
|
|
|
|
|
you can compile the project and it will generate this DLL.
diligent hands rule....
|
|
|
|
|
Is Gios-PDF-NET-library can convert whole .ASPX page to .PDF files ?. If its possible then please send me the full code with example how we can implement it for convert whole .Aspx page to .Pdf file. Otherwise please add your comment.
Thanks!!
|
|
|
|
|
Please inform me how to add windows other font. Like "Castellar","Myriad Pro".
When I use this font, its not working. The output is not with the selected font.
Please inform me how can I add the font.
|
|
|
|
|
I was wondering if you were considering adding code to read a pdf, and allow for searching, its a great library but my core requirement is the ability to search pdfs.
|
|
|
|
|
Hi,
I have used currency symbol ¥0.00 but when I produce a PDF report it shows ?0.00 instead of ¥0.00.
have you any idea how to solve this?
Thanks in advance.
My code was
PdfDocument myPdfDocument=new PdfDocument(PdfDocumentFormat.Letter_8_5x11_Horizontal);
Font FontBold=new Font("Courier New",9,FontStyle.Bold);
PdfTextArea reportTest = new PdfTextArea(FontBold, Color.Black, new PdfArea(myPdfDocument, 50, 20, 750, 50), ContentAlignment.MiddleCenter, "testing Currency is ¥0.00 ");
PdfPage newPdfPage=myPdfDocument.NewPage();
newPdfPage.Add(reportTest);
newPdfPage.SaveToDocument();
myPdfDocument.SaveToFile("Example3.pdf");
|
|
|
|
|
|
Hai
I generated the pdf report. Now i want to add the images in the pdf table. Actually i added the image heading of the PDF report, but i am unable to add within the table. So how to add images within the table, i am not getting any idea. Please ....help me.
knowledgetoyou.com
|
|
|
|
|
.. must be Send("startxref\n" + (startxref+14)+"\n");
That is because of:
1) {Send("%PDF-1.4\n");} was not counted to counter pos => makes offset error 9
2) Please attend the followind from the Adobe PDF Reference:
"Note that the value following the startxref keyword is now the offset of the crossreference stream rather than an xref keyword. For files that use cross-reference streams entirely (that is, PDF 1.5 files that are not hybrid-reference files; see “Compatibility with PDF 1.4” on page 85), the keywords xref and trailer are no longer used. Therefore, with the exception of the “startxref address %%EOF” segment and comments, a PDF 1.5 file is entirely a sequence of objects."
makes offset error 5 (because of we write "xref\n" - 5 bytes)
Summary: 5+9=14
Open Example 2 in HEX Mode:
Offset of stream after last xref (pointed to 0 after xref\n): 1BEF1
Offset mentioned at startfxref: 1BEE3 (114403 dec)
1BEF1-1BEE3 = E (14 dec)
That solves some problems.
Alex
modified on Wednesday, September 21, 2011 4:07 AM
|
|
|
|
|
At Sep. 13 2005 Paolo wrote: "you can download the project from my site http://www.paologios.com"
But I could not find anything at this page? Know somebody the URL?
Thanks in advice!
Alex
|
|
|
|
|
Because this is still amazing library for today, it will be really very nice to update the code. The new code should implement all improvements posted here and 'privatelly' hosted and changed via mail.
Also new improvements should be continuosly integrated and code updated. At the beginning it could be probably possible to post (and update) all changes/improvements inside ONE forum message.
Can thuch thing be done on CodeProject with some smart tool like "Code Changes" - so each can see all changes and update their code at once? Is it possible to do within this project or a new one should be started?
Could it be helpfull to merge this project with this one: PDF Library for creating PDF with tables and text, in C#[^]
Thanks in advice for is your suggestion!
Alex
|
|
|
|
|
Hi Paolo,
Good Day!
I am a newbie in C# and I am doing some learnings and self studying. I really want to learn more and become one of the best C# developers, at least be near your level.
I tested your PDF library and it works great! =)
I just want to ask, can i add page numbering to the PDF file. I just think it will be good to have the display of pages. NOthing against the PDF library, in fact I really find it very easy to use in my studying.
Thank you very much. Keep up the good work and I hope you create more of this kind of libraries.
Kind regards,
Jayvee
|
|
|
|
|
Yea. U can add the page number in your PDF Report.
see the code :
int pgNo = 1;
while (!myPdfTable.AllTablePagesCreated)
{
PdfPage newPdfPage = myPdfDocument.NewPage();
PdfTablePage newPdfTablePage =
myPdfTable.CreateTablePage(new PdfArea(myPdfDocument,48, 130, 500, 670));
PdfTextArea pageNumber = new PdfTextArea(new Font("Verdana", 8, FontStyle.Regular), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 450, 1600), ContentAlignment.MiddleRight, "Page Number : " + pgNo++.ToString());
newPdfPage.Add(newPdfTablePage);
newPdfPage.Add(pta);
newPdfPage.Add(ToDate);
newPdfPage.Add(pageNumber);
newPdfPage.SaveToDocument();
}
|
|
|
|
|
Hi,
this library is very useful. I want to can I use this library in asp.net 2005 and if Yes then how.
Actually I have a web page that generate reports. I want to save that report in a pdf on the users computer.
Please help me.
thanks
|
|
|
|
|
Hi
I also want to use in web application. I tried to use in web apps, but getting some error. Please help me. This is my code i write to save the generated PDF.
newPdfPage.SaveToDocument();
myPdfDocument.SaveToFile(HttpContext.Current.Server.MapPath(@"~/PdfFiles/" ));
Please help me.
|
|
|
|
|
Yes, we can use in web application. I used in web application. But when i use in web application, i got some error. The error is "error generating the document". So to resolve the error i add one more dll. The name of dll is ICSharpCode.SharpZipLib.dll. So when i add the dll the error removed.
Note: If you want to use the dll in your Application please add the two important dll.
1)Gios Pdf.NET.dll
2)ICSharpCode.SharpZipLib.dll
so see the sample code. how to use in web application
public void ShowTable()
{
IList<alert> data = GetAlertDetails();
if (data != null)
{
lvAlert.DataSource = null;
lvAlert.DataSource = data;
lvAlert.DataBind();
}
else
{
lvAlert.DataSource = null;
dataPager2.Visible = false;
lblmsg.Text = "No Record Found";
isNoRecord = true;
}
var countData = data.Count();
if (countData <= 0)
{
lblmsg.Visible = true;
lblmsg.Text = "No Records";
return;
}
DataTable d1t = new DataTable();
d1t.Columns.Add("No.");
d1t.Columns.Add("Type");
d1t.Columns.Add("Severity");
d1t.Columns.Add("Description");
d1t.Columns.Add("Job Name");
d1t.Columns.Add("Create Date");
int i = 1;
foreach (Alert rp in data)
{
DataRow dr = d1t.NewRow();
dr["No."] = i.ToString();
dr["Type"] = rp.Type;
dr["Severity"] = rp.Severity;
dr["Description"] = rp.Description;
dr["Job Name"] = rp.JobName;
dr["Create Date"] = rp.CreateDate;
i++;
d1t.Rows.Add(dr);
}
PdfDocument myPdfDocument = new PdfDocument(PdfDocumentFormat.InCentimeters(21, 29.7));
var count = data.Count();
PdfTable myPdfTable = myPdfDocument.NewTable(new Font("Verdana", 7), count, 6, 4);
myPdfTable.ImportDataTable(d1t);
myPdfTable.HeadersRow.SetColors(Color.White, Color.Gray);
myPdfTable.SetBorders(Color.Gray, 0.5, BorderType.ColumnsAndBounds);
myPdfTable.SetColors(Color.Black, Color.White, Color.Gainsboro);
myPdfTable.SetColumnsWidth(new int[] { 4, 12, 9, 30, 13, 15 });
myPdfTable.SetContentAlignment(ContentAlignment.MiddleCenter);
myPdfTable.Columns[3].SetContentAlignment(ContentAlignment.TopLeft);
PdfImage LogoImage = myPdfDocument.NewImage(HttpContext.Current.Server.MapPath(@"~/images/perpetuiti_logo.jpg"));
PdfTextArea pta = new PdfTextArea(new Font("Verdana", 15, FontStyle.Bold), Color.DodgerBlue
, new PdfArea(myPdfDocument, 0, 20, 595, 80), ContentAlignment.MiddleCenter, "Alerts Log");
PdfTextArea ptaGroup = new PdfTextArea(new Font("Verdana", 9, FontStyle.Bold), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 220, 160), ContentAlignment.MiddleRight, "Group Name : ");
PdfTextArea ptaGroupName = new PdfTextArea(new Font("Verdana", 9, FontStyle.Bold), Color.Black
, new PdfArea(myPdfDocument, 70, 0, 280, 160), ContentAlignment.MiddleRight, ddlGroup.SelectedItem.Text.ToString());
PdfTextArea From = new PdfTextArea(new Font("Verdana", 8, FontStyle.Bold), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 100, 190), ContentAlignment.MiddleRight, "From: ");
PdfTextArea FromDate = new PdfTextArea(new Font("Verdana", 8, FontStyle.Underline), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 140, 190), ContentAlignment.MiddleRight, txtFromDate.Text);
PdfTextArea To = new PdfTextArea(new Font("Verdana", 8, FontStyle.Bold), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 360, 190), ContentAlignment.MiddleRight, "To: ");
PdfTextArea ToDate = new PdfTextArea(new Font("Verdana", 8, FontStyle.Regular), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 400, 190), ContentAlignment.MiddleRight, txtToDate.Text);
int pgNo = 1;
while (!myPdfTable.AllTablePagesCreated)
{
PdfPage newPdfPage = myPdfDocument.NewPage();
PdfTablePage newPdfTablePage =
myPdfTable.CreateTablePage(new PdfArea(myPdfDocument, 48, 100, 500, 670));
PdfTextArea pageNumber = new PdfTextArea(new Font("Verdana", 8, FontStyle.Regular), Color.Black
, new PdfArea(myPdfDocument, 50, 0, 450, 1600), ContentAlignment.MiddleRight, "Page Number : " + pgNo++.ToString());
newPdfPage.Add(LogoImage, 440, 15, 120);
//newPdfPage.Add(LogoImage, 440, 80, 82);
newPdfPage.Add(newPdfTablePage);
newPdfPage.Add(pta);
newPdfPage.Add(ptaGroup);
newPdfPage.Add(ptaGroupName);
newPdfPage.Add(From);
newPdfPage.Add(FromDate);
newPdfPage.Add(To);
newPdfPage.Add(ToDate);
newPdfPage.Add(pageNumber);
newPdfPage.SaveToDocument();
}
str = DateTime.Now.ToString().Replace("/", "");
str = str.Replace(":", "");
str = str.Substring(0, str.Length - 5);
str = System.Text.RegularExpressions.Regex.Replace(str, @"\s", "");
str = ddlGroup.SelectedItem.Text.ToString() + "Alert" + str + ".pdf";
myPdfDocument.SaveToFile(HttpContext.Current.Server.MapPath(@"~/PdfFiles/" + str));
string myUrl = "/PdfFiles/" + str;
string fullURL = "window.open('" + myUrl + "', '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=DataLog Report' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
lblmsg.Text = "";
}
knowledgetoyou
|
|
|
|
|
I get an excpetion about the height! Then I cant use the library
|
|
|
|
|