Created
June 10, 2023 20:48
-
-
Save bjoerntx/fedcfcaa987f5614f5fbe6053b78217d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public byte[] ExtractSmartDocument(string DocumentName) { | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
// the load PDF document | |
TXTextControl.LoadSettings loadSettings = new LoadSettings(); | |
tx.Load(DocumentName, | |
TXTextControl.StreamType.AdobePDF, | |
loadSettings); | |
// loop through all attachments to find the original document | |
// and the annotations | |
foreach (EmbeddedFile file in loadSettings.EmbeddedFiles.Reverse()) { | |
if (file.FileName == "original.tx") | |
return (byte[])file.Data; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment