本文整理匯總了C#中iTextSharp.text.pdf.PRTokeniser.GetHeaderOffset方法的典型用法代碼示例。如果您正苦於以下問題:C# PRTokeniser.GetHeaderOffset方法的具體用法?C# PRTokeniser.GetHeaderOffset怎麽用?C# PRTokeniser.GetHeaderOffset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iTextSharp.text.pdf.PRTokeniser
的用法示例。
在下文中一共展示了PRTokeniser.GetHeaderOffset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetOffsetTokeniser
/**
* Utility method that checks the provided byte source to see if it has junk bytes at the beginning. If junk bytes
* are found, construct a tokeniser that ignores the junk. Otherwise, construct a tokeniser for the byte source as it is
* @param byteSource the source to check
* @return a tokeniser that is guaranteed to start at the PDF header
* @throws IOException if there is a problem reading the byte source
*/
private static PRTokeniser GetOffsetTokeniser(IRandomAccessSource byteSource) {
PRTokeniser tok = new PRTokeniser(new RandomAccessFileOrArray(byteSource));
int offset = tok.GetHeaderOffset();
if (offset != 0){
IRandomAccessSource offsetSource = new WindowRandomAccessSource(byteSource, offset);
tok = new PRTokeniser(new RandomAccessFileOrArray(offsetSource));
}
return tok;
}