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.

Fri Jul 10, 2015 1:14 pm

Hi,

I am able to load pdf file using spire.pdf loadfromfile() function & able to get number of pages from file. Now my requirement is that I want to get file name & attribute "\ModDate" using spire.pdf for loaded file.Plz let me know how to get both the things in C#

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Mon Jul 13, 2015 2:29 am

Hello,

Thanks for your inquiry.
1) So sorry that our product doesn't support getting file name at this stage. We will add a tag for this feature in our future upgrade.
2)Here is the code about geting attribute "\ModDate".
Code: Select all
 PdfDocument doc = new PdfDocument(@"test.pdf");
            PdfDocumentInformation info = doc.DocumentInformation;         
            DateTime time = info.ModificationDate; 


Best Regards,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Mon Jul 13, 2015 7:03 am

Thanks a lot Sweety for your prompt reply.

Please let me know once it is ready with tag for getting file name.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Mon Jul 13, 2015 8:53 am

Hello,

Thanks for your reply.
We will inform you when it is ready with tag for getting file name.

Best Regards,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Tue Jul 14, 2015 7:37 am

Hi Sweety,

Thanks for the reply.

Plz let me know how to set font for the header,how to add pdf files in another pdf. Also i need no. of pages written for specific pdf.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Tue Jul 14, 2015 9:18 am

Hello,

Thanks for your inquiry.
1) You can refer to the below code to set the font.
Code: Select all
 PdfTrueTypeFont font1 = new PdfTrueTypeFont(new Font("Arial", 16f, FontStyle.Bold));

2) There is a tutorial about merging PDF files on our website. You can see it via link below and have a try:
http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Merge-PDF-Files-with-New-Method-in-C.html
3) Here is the code for your reference.
Code: Select all
  PdfDocument doc = new PdfDocument("5371.pdf");
            PdfPageBase page;
            for (int i = 0; i < doc.Pages.Count; i++)
            {  page = doc.Pages[i];
                 PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", 9f, FontStyle.Italic));
                 float height = font.MeasureString("").Height;
                 float width = font.MeasureString("").Width;
                 page.Canvas.DrawString(string.Format("{0}", i + 1), font, PdfBrushes.Black, new PointF(page.Size.Width -doc.PageSettings.Margins.Left - doc.PageSettings.Margins.Right-width, page.Size.Height - doc.PageSettings.Margins.Top - doc.PageSettings.Margins.Bottom-height));
             }
            doc.SaveToFile("output.pdf");


Best Regards,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Tue Jul 14, 2015 9:44 am

Thanks Sweety.

Yaa i got merging of PDFs from site. Let me try your suggestions. Thanks a lot for your prompt reply.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Tue Jul 14, 2015 2:00 pm

Hi Sweety,

I am creating blank PDF & trying to add pages or pdfs. I am getting the results.But while Creating blank PDF ,it is with page count 1 & after appending new PDF will contain blank page as well. So i used RemovedAt() function while creating blank PDF. It is not working. Still blank page remains there.

Plz let me know deleting blank page from newly created PDF. I need fresh PDF wthout any page in it.

My code is as below:

spireoutDoc = new PdfDocument();
spireoutDoc.SaveToFile(sFileName);
spireoutDoc.Pages.RemoveAt(0);
spireoutDoc.SaveToFile(sFileName);

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Wed Jul 15, 2015 2:32 am

Hello,

Thanks for your reply.
Please change the second row of your code to the below code.
Code: Select all
spireoutDoc.LoadFromFile(sFileName);


Best Regards,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Wed Jul 15, 2015 9:42 am

Dear Sweety,

Thanks for your prompt reply.

It worked well with your suggestion.I have done loadfromfile & remove after blank file creation & saving.

Regards,
Shipa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Wed Jul 15, 2015 10:12 am

Hi Sweety,

Is there anyway to check blank pages in given PDF & removing them.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Wed Jul 15, 2015 2:10 pm

Hi Sweety,

Found the answer for above query from below link:

http://www.e-iceblue.com/Tutorials/Spir ... -in-C.html

Thanks.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Wed Jul 15, 2015 2:26 pm

Hi Sweety,

i was going through above link. I have installed "3.0.40" version of "Spire.pdf" via NUGET which is free opensource. In link they mentioned for finding & removing blank page we need to install 3.43.0 or higher. How i will get this version via NUGET. is it free or need to purchase.

Is there any other alternative which is possible with 3.40 version of spre.pdf.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Thu Jul 16, 2015 2:38 am

Hello,

Thanks for your reply.
Please enter the word "spire.pdf" in the search box.
After getting the query result, please find the Spire.PDF for .NET. It's the latest version. Note that the version displays on the right side is 3.4.27.
This version is commercial version. It will work normally except for an evaluation warning message.

Best Regards,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Mon Jul 20, 2015 6:27 am

Thanks Sweety.

I got everything worked with your suggestion. Only the problem is evalation message. Please can you tell me is there any way to remove that message without using license . I mean by editing PDF can we remove that message.

Regards,
Shilpa

shilpa_mistry
 
Posts: 10
Joined: Fri Jul 10, 2015 12:01 pm

Return to Spire.PDF

cron