c# - Determine properties such as if PDF is Simplex or Duplex in iTextSharp -


I am using iTextSharp to read and manage PDF documents. Things like background or logo and overlay stamping for supporter are PDF statement files, so I can not give an example. I am thinking that to see the PDF settings, whether the PDF file is simple or duplex, and such information. Any help or suggestions would be appreciated. At this time I do a test for some of the second page criteria, and this is a bad and bad way to do this. Thanks in advance, and happy coding!

duplex mode is stored in the document / viewerPreferences / duplex Under the key, the dictionary supports this three value, / duplex flip length agge , / duplexflip short adz , and / simplex is. You can use the code given below to inspect this:

  // Be the default by default because it was introduced in PDF 1.7 boolean isDuplex = false; // Bind a reader to our reader (var r = New PdfReader (testFile)) {// Get Visual Preferences pre prefs = r.Catalog.GetAsDict (PdfName.VIEWERPREFERENCES); // Make sure that we got something (prefs! = Null) {// get duplex key var duplex = prefs.Get (PdfName.DUPLEX); // Make sure we got something and it is one of the duplex mode Heduplex = (Duplex! = Null & amp; (Duplex.qualz (PDFNMA). Duplex.Aquals (PDFFamilyDifleflipsHotadez))); }}    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -