remove whitespace doesn't work

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
MiBa
User
Posts: 17
Joined: Fri Feb 19, 2016 1:30 pm
Location: Germany

remove whitespace doesn't work

Post by MiBa »

Hi everybody,

I have a problem removing the white space on my documents. I use the method as suggested in the wiki https://sdkhelp.pdf-xchange.com/vie ... _cropPages:

Code: Select all

//C#
private void RemoveWhiteSpaces(PDFXEdit.IPXV_Document pDoc, PDFXEdit.PXV_Inst pInst)
{
	if (pDoc == null)
		return;
	int nID = pInst.Str2ID("op.document.cropPages", false);
	PDFXEdit.IOperation Op = pInst.CreateOp(nID);
	PDFXEdit.ICabNode input = Op.Params.Root["Input"];
	input.v = pDoc;
	PDFXEdit.ICabNode options = Op.Params.Root["Options"];
	options["Flags"].v = 256; //Remove white spaces
	Op.Do();
}
This works on on most documents. But not on all. I attached two samples where this method doesn't work. what's the difference? How can I crop these documents too?
When I use the XChange Editor it always works.

Regards
Michael
Attachments
Sample2.pdf
(71.83 KiB) Downloaded 82 times
Sample1.pdf
(37.86 KiB) Downloaded 87 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: remove whitespace doesn't work

Post by Tracker Supp-Stefan »

Hello MiBa,

The first thing that comes to mind is that the builds of the SDK and the end user Editor you have are not the same.
Please check and ensure you have all the latest files for the Editor SDK, and then let us know if it still doesn't work!

Regards,
Stefan
MiBa
User
Posts: 17
Joined: Fri Feb 19, 2016 1:30 pm
Location: Germany

Re: remove whitespace doesn't work

Post by MiBa »

Hi Stephan,

I use PDFXEditCore.x64.dll/PDFXEditCore.x86.dll the version of both is 6.0.322.7

Regards
Michael
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: remove whitespace doesn't work

Post by Tracker Supp-Stefan »

Thanks for confirming this MiBa,

Will ask a colleague from the dev team to take a look and advise further!

Cheers,
Stefan
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: remove whitespace doesn't work

Post by Sasha - Tracker Dev Team »

Hello Michael,

The flags were changed dues some bug fixes. I've updated the description of the operation - please use this code:

Code: Select all

options["Flags"].v = 1024 | 2048; //Remove white spaces
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply