problem with PXCp_PlaceContents VB
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators
problem with PXCp_PlaceContents VB
I am trying to create a header for a pdf document and then merge an existing document with the new one. I am able to create the new document, transfrom the existing document to shrink the first page, but can't merge the 2 using PXCp_PlaceContents. I do not receive an error message, and all I end up with in the end is the new document with no data from the exisiting doc. Here is code I am trying to use
res = PXCp_Init(NewPDF, InitPDF, InitPDFDevCode)
If IS_DS_FAILED(res) Then GoTo Error
res = PXCpVB_ReadDocumentW(NewPDF, CurrentProjectFolder$ & PdfFileName$, 0)
If IS_DS_FAILED(res) Then GoTo Error
Dim placeInfo As PXCp_ContentPlaceInfo
placeInfo.Alignment = 0
placeInfo.DestPage = NewPDF
placeInfo.SrcPage = ptrpdf
res = PXCp_PlaceContents(NewPDF, ptrpdf, 1, placeInfo, 0)
If IS_DS_FAILED(res) Then GoTo Error
res = PXCpVB_WriteDocumentW(NewPDF, CurrentProjectFolder$ & PdfFileName$, PXCp_CreationDisposition_Overwrite, PXCp_Write_Release)
res = PXCp_Init(NewPDF, InitPDF, InitPDFDevCode)
If IS_DS_FAILED(res) Then GoTo Error
res = PXCpVB_ReadDocumentW(NewPDF, CurrentProjectFolder$ & PdfFileName$, 0)
If IS_DS_FAILED(res) Then GoTo Error
Dim placeInfo As PXCp_ContentPlaceInfo
placeInfo.Alignment = 0
placeInfo.DestPage = NewPDF
placeInfo.SrcPage = ptrpdf
res = PXCp_PlaceContents(NewPDF, ptrpdf, 1, placeInfo, 0)
If IS_DS_FAILED(res) Then GoTo Error
res = PXCpVB_WriteDocumentW(NewPDF, CurrentProjectFolder$ & PdfFileName$, PXCp_CreationDisposition_Overwrite, PXCp_Write_Release)
-
- Site Admin
- Posts: 8209
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Oops - looks like you have misread the function documentation ...
placeInfo.DestPage = NewPDF // here shoud be the page index in the destination file, NOT the destination file handle
placeInfo.SrcPage = ptrpdf // and here - page index in the source file
HTH
placeInfo.DestPage = NewPDF // here shoud be the page index in the destination file, NOT the destination file handle
placeInfo.SrcPage = ptrpdf // and here - page index in the source file
HTH
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 8209
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
No Problem 

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
Best regards
Tracker Support
http://www.tracker-software.com
I still have the same problem, but now I get an error when I try to open the document in adobe. The error is An Unrecognized token "cm1" was found. I probably still have something wrong with the PXCp_PlaceContents function. I have zipped the code I am trying to use along with one of the exisiting pdf files. Thanks
- Attachments
-
- placecontent.zip
- zip file contains text file of vb code and 1 pdf file.
- (100.54 KiB) Downloaded 149 times
-
- Site Admin
- Posts: 3633
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
I'm afraid we need both source files and a result file. Please post them here or send me on Ivan@tracker-software.com
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- Site Admin
- Posts: 3633
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact:
Thanks for the files. We found where the problem is and now it is fixed. The fix will be available into the next build.
Tracker Software (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- Site Admin
- Posts: 3633
- Joined: Thu Jul 08, 2004 10:36 pm
- Location: Vancouver Island - Canada
- Contact: