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.

Wed Oct 28, 2015 2:16 am

I need to generate a PDF to be printed on an ID-1 format (credit card sized) identity card which has dimensions of 53.98mm by 85.60mm. How can I add this as an option for PdfPageSize?

Thanks
Julian

julians26
 
Posts: 8
Joined: Thu Oct 15, 2015 1:26 am

Wed Oct 28, 2015 5:59 am

Hi Julian,

Thanks for your inquiry.
Please refer to this code to set page size.
Code: Select all
  SizeF size = new SizeF(2f,3f);
  PdfPageBase page = pdfDoc.Pages.Add(size);


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2772
Joined: Wed Jun 27, 2012 8:50 am

Fri Oct 30, 2015 6:29 am

Thanks Amy.

Once I used unitCvtr.ConvertUnits() to convert cm to points, I was able to get the page size I wanted using your code.

Regards
Julian

julians26
 
Posts: 8
Joined: Thu Oct 15, 2015 1:26 am

Fri Oct 30, 2015 7:42 am

Hi Julian,

Thanks for your message.
Welcome to write to us again if you have further issues. We are here to help you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2772
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF