|
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
|
|
|
|
|
Can you show the code causing the problem?
|
|
|
|
|
See the reason is like that :
PdfTable myPdfTable = myPdfDocument.NewTable(new Font("Verdana", 7), countData, 6, 4);
myPdfTable.SetColumnsWidth(new int[] { 4,8,13,15,10,5 });
Note: Here countData is total number of records we are getting from the object and 6 is the total number of column, we are going to populate in the PDF report. So total number of column must be equal to setcolumnwidth.
I hope it is helpful for u.
|
|
|
|
|
1.I want to display arabic text in the pdf document and change the text direction from right to left
2.add the images in the header and the footer of the pdfdocument and then save it as pdf template so that can be used for all the documents
how can i achieve in this library
regards
kabilan shanmugavel
|
|
|
|
|
Hi,
Have you found solution for this?
Thanks.
|
|
|
|
|
This is just what I needed to get a pdf start ! There are a few bugs here and there, but
nice work ! I did change adding an image to the page from file to Bitmap for flexiblity.
|
|
|
|
|
- the length of the xref table is not correct (1 longer than indicated)
- the values of the xref table are not correct (first value can not start at 0, but after the pdf header)
- the length for streams must be /Length and not /Lenght
- the file is stored in text mode, which does a convertion from lf to crlf, this gives problems in the calculation of the xref table and gives problems in compressed parts
|
|
|
|
|
Very nice document. Thank you for the library source code and detail.
|
|
|
|
|
Please I want to add this word in the pdf: "TEST".
How can I do?
modified on Friday, November 27, 2009 3:47 AM
|
|
|
|
|
|
Please write your exact requirement. Then i will reply to u.
|
|
|
|
|