Page 1 of 1

problem with PXCp_PlaceContents VB

Posted: Thu Oct 18, 2007 4:03 pm
by wesallen
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)

Posted: Thu Oct 18, 2007 4:27 pm
by John - Tracker Supp
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

Posted: Thu Oct 18, 2007 4:31 pm
by wesallen
Thanks

Posted: Thu Oct 18, 2007 4:34 pm
by John - Tracker Supp
No Problem :)

Posted: Thu Oct 18, 2007 8:06 pm
by wesallen
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

Posted: Fri Oct 19, 2007 7:26 am
by Ivan - Tracker Software
I'm afraid we need both source files and a result file. Please post them here or send me on Ivan@tracker-software.com

Posted: Fri Oct 19, 2007 1:07 pm
by wesallen
Files b4 and after PXCp_PlaceContents

Posted: Fri Oct 19, 2007 1:42 pm
by Ivan - Tracker Software
Thanks for the files. We found where the problem is and now it is fixed. The fix will be available into the next build.

Posted: Fri Oct 19, 2007 2:25 pm
by wesallen
When will the next build be available?

Posted: Fri Oct 19, 2007 2:46 pm
by Ivan - Tracker Software
It should be available next week