A) When using the Viewer Application to Extract pages with Form Fields, the Form Fields are removed from the extracted document.
Load the Viewer.
Load a multipage document with Form Fields on it. I've attached on in the updated ZIP file.
Extract the first page to a file.
Open the file and notice that all form fields have been removed. Bad news!
B) When using code to Extract pages with Form Fields, the Form Fields are removed. Code snippet is below. Probably same issue as "A" above but ...
Code: Select all
private void _loadExtractFile_Click(object sender, EventArgs e)
{
axCoPDFXCview1.OpenDocument("C:\\temp\\MultipageForm.PDF");
axCoPDFXCview1.GetActiveDocument(out _activeDocumentId);
}
private void _extractBug_Click(object sender, EventArgs e)
{
string temporaryFile = "C:\\temp\\ExtractedPDFWithoutFormFields.PDF";
string temporaryPath = Path.GetDirectoryName(temporaryFile);
string pageRange = "1";
try
{
object dataIn = null;
object dataOut = null;
// Exit any "edit" modes we may be in. Force the viewer into a predictable state.
axCoPDFXCview1.FlushDocument(_activeDocumentId, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.RangeType", "Exact", 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.RangeText", pageRange, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.ExtractToFiles", 1, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.ToOneFile", 1, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.DestFolder", temporaryPath, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.DestFileName", temporaryFile, 0);
axCoPDFXCview1.SetProperty("Operations.ExtractPages.DeleteAfterExtract", 0);
// Added the following line to help Tracker reproduce the problem.
axCoPDFXCview1.ApplyAllCachedChanges();
// Note that if the output file exists, you will be prompted to overwrite even though
// you are telling the viewer to display No UI.
axCoPDFXCview1.DoVerb(null, "ExtractDocumentPages", _activeDocumentId, out dataOut, (int)PXCVA_Flags.PXCVA_NoUI);
}
catch (Exception ex)
{
}
}
C) When using the code above, if the target file currently exists on disk, UI will be presented to the user to overwrite the file. IMHO, no UI should ever show as I'm asking for PXCVA_NoUI in the command. This is something easy to work around though.
Version 2.5.195.
Win7, 64 bit. App compiled as 32 bit.
Currently cloudy outside.
Scream if you need more.