Exemplo n.º 1
0
 public bool CheckIfDocumentWillBeModified(ILocalPdfEffectSettings localDataObject)
 {
     LocalTextEffectSettings localData = (LocalTextEffectSettings)localDataObject;
     if (localData.LocalTextIsUsed && localData.Text.Trim() == "") return false;
     if (!localData.LocalTextIsUsed && this.Text.Trim() == "") return false;
     return true;
 }
Exemplo n.º 2
0
        public void ApplyEffect(ILocalPdfEffectSettings localDataObject, PdfDocument document)
        {
            LocalTextEffectSettings localData = (LocalTextEffectSettings)localDataObject;
            string drawText = Text;
            if (useLocalTexts) drawText = localData.Text;

            for (int i = 0; i < document.PageCount; i++)
            {
                PdfPage page = document.Pages[i];
                if (pages == PagesType.All) WriteOnPage(page, drawText);
                if (pages == PagesType.First && i == 0)
                {
                    WriteOnPage(page, drawText);
                    break;
                }
            }
        }