Overlay using Ax Control

PDF-XChange Viewer SDK
Simple DLL and ActiveX

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

Post Reply
fiscal
User
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Overlay using Ax Control

Post by fiscal » Tue Feb 21, 2012 5:16 am

Hi Craig,

I was wanting to print a document (letter) but wanted to overlay this onto a letterhead (pdf file?).

I saw the post by Mike Hansen, for a form, but I could not find anything in the AX docs about overlay.

I know it can be done in PDF Tools 4 but I already have the letter open in the AX class as follows -

Code: Select all

! create the new pdf document
PDF5:Rtn = PDF5.NewDocumentfromRTF(Loc:DocID,PDFFileQ,PXCVA_NoUI)
PDF5:Rtn = PDF5.SaveDocumentAs(loc:DocID,clip(loc:FilePath) & clip(loc:FileName) & '.pdf',true)

PDF5:Rtn = PDF5.GetPrintSettings(MyPrintSettings) ! preloads MyPrintSettings with default settings
!*** Make changes to MyPrintSettings here
MyPrintSettings.RangeType     = PXCVA_RANGETYPE_ALL
MyPrintSettings.PrintToFile   = False
MyPrintSettings.RangeFilter   = PXCVA_RANGEFILTER_ALL
MyPrintSettings.PaperRotate   = PXCVA_RANGEFILTER_ALL
MyPrintSettings.ScaleType     = PXCVA_PST_NONE
MyPrintSettings.AutoRotate    = True
MyPrintSettings.AutoCentre    = True
MyPrintSettings.PaperByPage   = True
! print document
PDF5:Rtn = PDF5.PrintDocument(loc:DocID, MyPrintSettings)
! Close Document
PDF5:Rtn = PDF5.CloseDocument(loc:DocId,PXCVA_NoUI)
Is there anyway to insert the overlay file in somehow (or will this be a v3 feature?)

Thanks

Tony

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Overlay using Ax Control

Post by Tracker - Clarion Support » Tue Feb 21, 2012 2:33 pm

Hi Tony!

Let me check into this further.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Overlay using Ax Control

Post by Tracker - Clarion Support » Tue Feb 21, 2012 6:08 pm

Hi Tony!

PDF Overlays can be added using PDF-Tools.

However this can't be done in the Viewer at all, sorry. Of course, you could write the document from the Viewer, process it "silently" using PDF-Tools, and reopen in the Viewer.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

fiscal
User
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Overlay using Ax Control

Post by fiscal » Tue Feb 21, 2012 10:48 pm

Thanks Craig.

Just as a side note. What issues, if any, will there be on opening and closing pdf files between the two classes? Is there likely to be any performance issues or possible i/o conflicts with files not closing quickly enough?

I ask this, as this would be the new code flow would be -

Code: Select all

PDF5:Rtn = PDF5.NewDocumentfromRTF(Loc:DocID,PDFFileQ,PXCVA_NoUI)
PDF5:Rtn = PDF5.SaveDocumentAs(loc:DocID,clip(loc:FilePath) & clip(loc:FileName) & '.pdf',true)
PDF5:Rtn = PDF5.CloseDocument(loc:DocId,PXCVA_NoUI)

! open the same pdf in PDF-Tools class
Do the overlay stuff
Close the file

! reopen the file in the AX class
PDF5:Rtn = PDF5.OpenDocument(loc:DocID,clip(loc:FilePath) & clip(loc:FileName) & '.pdf',true)
PDF5:Rtn = PDF5.GetPrintSettings(MyPrintSettings) ! preloads MyPrintSettings with default settings
!*** Make changes to MyPrintSettings here
MyPrintSettings.RangeType     = PXCVA_RANGETYPE_ALL
MyPrintSettings.PrintToFile   = False
MyPrintSettings.RangeFilter   = PXCVA_RANGEFILTER_ALL
MyPrintSettings.PaperRotate   = PXCVA_RANGEFILTER_ALL
MyPrintSettings.ScaleType     = PXCVA_PST_NONE
MyPrintSettings.AutoRotate    = True
MyPrintSettings.AutoCentre    = True
MyPrintSettings.PaperByPage   = True
! print document
PDF5:Rtn = PDF5.PrintDocument(loc:DocID, MyPrintSettings)
! Close Document
PDF5:Rtn = PDF5.CloseDocument(loc:DocId,PXCVA_NoUI)
I could not find any class methods in PDF Tools that will just print the document like the Ax classes do?

Thanks

Tony

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Overlay using Ax Control

Post by Tracker - Clarion Support » Wed Feb 22, 2012 1:24 am

Hi Tony!

No, there are no PDF-to-Print methods in the PDF-Tools classes. Never have been.

The whole PDF-to-Print may be resolved in Viewer version 3 but that won't be before end of May.

As far as i know, you shouldn't see any major performance hits doing the processing as I suggested.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

fiscal
User
Posts: 138
Joined: Fri Aug 06, 2004 12:09 am
Contact:

Re: Overlay using Ax Control

Post by fiscal » Wed Feb 22, 2012 1:44 am

Thanks Craig,

Will give it a whirl....

See ya

Tony

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: Overlay using Ax Control

Post by John - Tracker Supp » Wed Feb 22, 2012 7:02 pm

;)
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
Tracker Support
http://www.tracker-software.com

Post Reply