public void VeryBasic() { string file = "data\\CS15.page6.pdf"; string folder = Util.GetProjectDir2(); string fullpath = System.IO.Path.Combine(folder, file); byte[] contents = System.IO.File.ReadAllBytes(fullpath); /// /// Invoke itext7 /// Contracts.IExtractDocument extractorPdfium = new SampleLib.Pdfium.NetSDK.Class1(); var pagesV7 = extractorPdfium.GetBlocks(contents); }
static void Main(string[] args) { try { string file = "CS15.page6.pdf"; byte[] contents = System.IO.File.ReadAllBytes(file); /// /// Invoke itext7 /// var extractorPdfium = new SampleLib.Pdfium.NetSDK.Class1(); var pagesV7 = extractorPdfium.GetBlocks(contents); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void FireItext5_Pdfium() { string file = "data\\CS15.page6.pdf"; string folder = Util.GetProjectDir2(); string fullpath = System.IO.Path.Combine(folder, file); byte[] contents = System.IO.File.ReadAllBytes(fullpath); /// /// Invoke itext5 /// Contracts.IExtractDocument extractor5 = new SampleLib.itext5.Class1(); var pagesV5 = extractor5.GetBlocks(contents); var blockV5_C = pagesV5[0].Blocks[40]; var blockV5_T = pagesV5[0].Blocks[231]; Trace.WriteLine($"Results obtained using itext5"); Trace.WriteLine($"itext5 Text={blockV5_C}"); Trace.WriteLine($"itext5 Text={blockV5_T}"); double gapBetweenRowsV5 = blockV5_C.Bottom - blockV5_T.Top; Trace.WriteLine($"Gap between 2 rows={gapBetweenRowsV5}"); Trace.WriteLine("-------------------------------------------"); /// /// Invoke itext5 /// Contracts.IExtractDocument extractorPdfium = new SampleLib.Pdfium.NetSDK.Class1(); var pagesVium = extractorPdfium.GetBlocks(contents); var blockVium_C = pagesVium[0].Blocks[40]; var blockVium_T = pagesVium[0].Blocks[231]; Trace.WriteLine($"Results obtained using Pdfium"); Trace.WriteLine($"pdfium Text={blockVium_C}"); Trace.WriteLine($"pdfium Text={blockVium_T}"); double gapBetweenRowsVium = blockVium_C.Bottom - blockVium_T.Top; Trace.WriteLine($"Gap between 2 rows={gapBetweenRowsVium}"); Trace.WriteLine("-------------------------------------------"); }