ExtractDocumentPages & Viewer App not extracting Form Fields

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

DSSavant
User
Posts: 216
Joined: Thu Jul 08, 2004 7:29 pm

ExtractDocumentPages & Viewer App not extracting Form Fields

Post by DSSavant »

Three bugs found:

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)
			{
			}
		}
Input file is in the attached ZIP file.


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.
You do not have the required permissions to view the files attached to this post.
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: ExtractDocumentPages & Viewer App not extracting Form Fi

Post by Paul - PDF-XChange »

Hi DSSavant,

thanks for posting that. These issues are already dealt with in V3 so there won't be 'fixes' in the 2.5 series.

hth
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
DSSavant
User
Posts: 216
Joined: Thu Jul 08, 2004 7:29 pm

Re: ExtractDocumentPages & Viewer App not extracting Form Fi

Post by DSSavant »

Paul,

Great news, could you point me to the 3.X SDK Download link? I need to ship my product in August but can't without the ability to extract pages with form fields.

Thanks in advance!
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: ExtractDocumentPages & Viewer App not extracting Form Fi

Post by Paul - PDF-XChange »

Hi DSSavant,

maybe my answer gave you the wrong idea. V3 is not ready for download. When I said
These issues are already dealt with in V3

I meant that we are aware of and have addressed the issues for the upcoming V3 release, not that it has already been released.
https://forum.pdf-xchange.com/ ... 521#p50521

Sorry for any confusion... :-(
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
DSSavant
User
Posts: 216
Joined: Thu Jul 08, 2004 7:29 pm

Re: ExtractDocumentPages & Viewer App not extracting Form Fi

Post by DSSavant »

Thanks Paul, I have worked around this problem (a complete hack and embarrassment of a workaround if there ever has been one).
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7370
Joined: Wed Mar 25, 2009 10:37 pm

Re: ExtractDocumentPages & Viewer App not extracting Form Fi

Post by Paul - PDF-XChange »

8)
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com