Unexpected watermark

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.
Amrutha84
User
Posts: 1
Joined: Wed Jan 30, 2019 5:31 pm

Unexpected watermark

Post by Amrutha84 »

We have a licensed v4.x version of PDF-X. It works without issues for short files. But, when a pdf of size 932 KB gets generated a watermark appears on each page. On speaking with your end support team, I got this update

'I have just finished discussing with the Dev team and I believe we know the cause. In older versions of the SDK this was a common occurrence due to developers removing their printer too soon. For smaller documents it works fine because the save operation begins quickly enough to catch the printer before it is removed, but with larger files the save does not start until after the printer is removed'
'you will need to alter your code so that the printer is not removed until after the save operation completes. The Save operation checks for the currently used printer and looks for its license, if the printer has already been removed, the save operation will see no license and these stamps appear'

I did that as follows:

static PDFx4::IPXCControlExPtr pxcControl;
static PDFx4::IPXCPrinterPtr pxcPrinter;


function Save()
{
SetStatusText("PDFx4 start");
if(pxcControl == NULL
&& FAILED(pxcControl.CreateInstance(__uuidof(PDFx4::CPXCControlEx))))
{
SetCursor(hOldCursor);
MessageBox("PDF-XChange v4 not installed or not properly registered.",
"PDF Export", MB_OK | MB_ICONERROR);
return;
}

SetStatusText("PDFx4 open");
if(pxcPrinter == NULL
&& (pxcPrinter = pxcControl->GetPrinter(L"", L"PDFx4",
L"key",
L"KeyRelated")) == NULL)
{
SetCursor(hOldCursor);
MessageBox("PDF-XChange v4 printer could not be created.",
"PDF Export", MB_OK | MB_ICONERROR);
return;
}

SetStatusText("PDFx4 config");
pxcPrinter->ResetDefaults();
pxcPrinter->Option[L"Save.File"] = lpFile;
pxcPrinter->Option[L"Save.ShowSaveDialog"] = FALSE;
pxcPrinter->Option[L"Save.WhenExists"] = 1; // L"Overwrite"
pxcPrinter->Option[L"Save.RunApp"] = FALSE;
pxcPrinter->Option[L"Saver.ShowProgress"] = FALSE;
pxcPrinter->ApplyOptions(0);

SetStatusText("PDFx4 swap");
pxcPrinter->SetAsDefaultPrinter();


VARIANT vTemplatePath; V_VT(&vTemplatePath) = VT_BSTR; SetStatusText("PDFx4 print");
V_BSTR(&vTemplatePath) = SysAllocString(_bstr_t(VU_PREV_DLG_HTM));
m_pBrowserApp->ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, &vTemplatePath, NULL);
Sync4dfComplete( kpxVu_nPDFxSync); // wait for onFileSaved notification

}

Function SaveDone()
{

C4dfSink c4dfSink(this);
SetStatusText("PDFx4 connect");
c4dfSink.DispEventAdvise(pxcPrinter);
Save()

SetStatusText("PDFx4 restore");
pxcPrinter->RestoreDefaultPrinter();

SetStatusText("PDFx4 disconnect");
c4dfSink.DispEventUnadvise(pxcPrinter);

SetStatusText("PDFx4 close");
pxcPrinter = NULL;

SetStatusText("PDFx4 stop");
pxcControl = NULL;

}


But, I still see the watermarks. What am I missing?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Unexpected watermark

Post by Sasha - Tracker Dev Team »

Hello Amrutha84,

From what I see this is not an Editor SDK question. Please post in the correct forum.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ