pdf not saving via c#

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics or PDF-XChange Viewer SDK if appropriate.

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

Post Reply
pdfsteve
User
Posts: 2
Joined: Wed Jun 19, 2013 2:04 pm

pdf not saving via c#

Post by pdfsteve »

My c# code is :-
Global.log.LogBook("saving as " + Global.pdfpath + Global.pdffile + "\\plot.pdf", 0);
PDFPrinter.set_Option("Save.SaveType", 2);
PDFPrinter.set_Option("Save.RunApp", false);
PDFPrinter.set_Option("Save.ShowSaveDialog", true);
PDFPrinter.set_Option("Save.Path", Global.pdfpath+Global.pdffile);
PDFPrinter.set_Option("Save.File", "plot.pdf");
PDFPrinter.SetAsDefaultPrinter();

csplot.Printing.Print(false); //.net plot control output

PDFPrinter.RestoreDefaultPrinter();

This displays a saveas dialog and i get a pdf file.
With Save.ShowSaveDialog set false, i get the progress bar, no saveas dialog (good) but no pdf file (bad). With offline printer checked a document of zero size appears.

Any ideas ?

v5 pdf-xchange printer 2012 build 269
w7 home premium x64 build7601,sp1

thanks,
Steve
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17948
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: pdf not saving via c#

Post by Tracker Supp-Stefan »

Hi Steve,

You might have just omitted it from the above code - but do make sure to call the ApplyOptions method after you finish with all the PDFPrinter.set_Option() entries.

Regards,
Stefan
pdfsteve
User
Posts: 2
Joined: Wed Jun 19, 2013 2:04 pm

Re: pdf not saving via c#

Post by pdfsteve »

thanks stefan,
I've now added the line
PDFPrinter.ApplyOptions(0);
this now shows the changes in printer preferences, however still no pdf file from the c# code
printed a .txt file via same pdf printer, this showed a progress bar with no of pages but still no pdf in the correct location.

added my options to PDFDriverAPI c# demo and this worked !!!
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: pdf not saving via c#

Post by Will - Tracker Supp »

:)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply