Пример #1
0
 /**
  * Returns picture object tied to specified CharacterRun
  * @param run
  * @param FillBytes if true, Picture will be returned with Filled byte array that represent picture's contents. If you don't want
  * to have that byte array in memory but only write picture's contents to stream, pass false and then use Picture.WriteImageContent
  * @see Picture#WriteImageContent(java.io.OutputStream)
  * @return a Picture object if picture exists for specified CharacterRun, null otherwise. PicturesTable.hasPicture is used to determine this.
  * @see #hasPicture(NPOI.HWPF.usermodel.CharacterRun)
  */
 public Picture ExtractPicture(CharacterRun run, bool FillBytes)
 {
     if (HasPicture(run))
     {
         return new Picture(run.GetPicOffset(), _dataStream, FillBytes);
     }
     return null;
 }
Пример #2
0
 /**
  * determines whether specified CharacterRun Contains reference to a picture
  * @param run
  */
 public bool HasPicture(CharacterRun run)
 {
     if (run.IsSpecialCharacter() && !run.IsObj() && !run.IsOle2() && !run.IsData())
     {
         // Image should be in it's own run, or in a run with the end-of-special marker
         if ("\u0001".Equals(run.Text) || "\u0001\u0015".Equals(run.Text))
         {
             return IsBlockContainsImage(run.GetPicOffset());
         }
     }
     return false;
 }
Пример #3
0
 /**
  * determines whether specified CharacterRun Contains reference to a picture
  * @param run
 */
 public bool HasHorizontalLine(CharacterRun run)
 {
     if (run.IsSpecialCharacter() && "\u0001".Equals(run.Text))
     {
         return IsBlockContainsHorizontalLine(run.GetPicOffset());
     }
     return false;
 }