Merge

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
cj
Posts: 17
Joined: Tue Aug 15 2006

Merge

Post by cj » Tue Aug 22 2006

Perhaps you an help with this. I understand how merge is supposed to work now and that will do.

I would think this would merge the document being created to c:\ecompad.pdf. So how come this doesn't work? I get OLE error code 0x80020006: Unknown name.

Code: Select all

* --- Print Cycle
SET PRINT ON
SET DEVI TO PRINT
pdf=CREATEOBJECT("cdintf.cdintf")
pdf.driverinit("Amyuni PDF Converter")
pdf.filenameoptions=1+2+16+128
*pdf.filenameoptions=1+2+16+128+64
pdf.defaultfilename="c:\test.pdf"
*pdf.setwatermark("Testing", "Arial", 32, 0, 255, 100, -100, .F.)
SET PRINTER TO NAME "Amyuni PDF Converter"
SET MEMOWIDTH TO 80

* --- Print Page Header
SET PRINTER FONT 'Arial',14 STYLE "B"
@ 1,80 say '____'

SET PRINTER FONT 'Arial',12
@ 3,10 SAY 'Account #:  1234567890'
@ 3,75 SAY 'Invoice #:    123456'
SET PRINTER FONT 'Arial',12 STYLE "B"
@ 3,93 say '_____'

SET PRINTER FONT 'Arial',12
@ 4,10  SAY 'Page 1' 
@ 4,75 SAY 'Bill Date:    01/01/1980'

@ 10,19 SAY 'Homer Simpson'
@ 11,19 SAY '59 Evergreen Terrace'
@ 12,19 SAY 'Springfield'

SET PRINTER FONT "Arial",10
@ 21,35 SAY "Plus Payments"
@ 21,60 SAY "Less"
@ 21,85 SAY "Ending"
EJECT


pdf.merge("c:\ecompad.pdf",.F.)
.
.
.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Tue Aug 22 2006

Hello,

merge is not a function of cdintf.cdintf, it is a function cdintf.document.

Here is a VFP code on using the Merge function:

NewPdf1 = CreateObject("CDIntf.Document")
NewPdf2 = CreateObject("CDIntf.Document")

NewPdf1.Open( "c:\file1.pdf")
NewPdf1.Merge( "c:\file2.pdf",0 ) // the last parameter here could be 0, 1 or 2
NewPdf1.Save( "c:\file3.pdf" )

For more information about the Merge() function parameter that apply to your version of the PDF Converter please check "Common Driver Interface.pdf" that you have. The documentation i have is for the latest release 2.50 and i don't want to add information that may not apply to your version.

Hope this helps.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Wed Aug 23 2006

Sorry, I didn't catch that.

I followed your example and it did merge the two documents. File2 and file1.pdf look fine when viewed but in the combined file3.pdf the portion that came from file2.pdf is garbage (random letters and numbers). Any ideas?

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Wed Aug 23 2006

Well, I'm closer. I turned off multilanguage and reprinted both documents and then merged them but the one being merged (c:\file2.pdf) in your example is missing letters and numbers at random. It doesn't insert any new ones like with multilanguage on but some are missing.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Wed Aug 23 2006

Hello,

As the version you are using is quite old, the missing numbers or characters could be due to that.

Are you using unicode characters effectively? because if you don't than you can remove the multilanguage support option while generating the pdf file and then try the merge again.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Thu Aug 24 2006

Joan,

I hope you received the email I sent you yesterday. I sent you samples of the 2 documents I'm merging and the resulting file which I find actually has all the info it's just some letters and all the numbers are invisible. The merge functionality is supposed to be in the version we own and I need to know what is happening.

They will upgrade here if it'll fix the problem but if it's supposed to work in the version we have and doesn't, how do we know it'll work in the new version? Also we don't want to put a version in that will change the way we currently produce the documents as that'll require a lot of code review and changes--see code below.

I really need to hear from you.

Thanks,
Chris

Code: Select all

filename="c:\test.pdf"
* --- Print Cycle
SET PRINT ON
SET DEVI TO PRINT
pdf=CREATEOBJECT("cdintf.cdintf")
pdf.driverinit("Amyuni PDF Converter")
pdf.filenameoptions=1+2+16
pdf.defaultfilename=filename
SET PRINTER TO NAME "Amyuni PDF Converter"
SET MEMOWIDTH TO 80

* --- Print Page Header
SET PRINTER FONT 'Arial',14 STYLE "B"
@ 1,80 say '____'

SET PRINTER FONT 'Arial',12
@ 3,10 SAY 'Account #:  1234567890'
@ 3,75 SAY 'Invoice #:    123456'
SET PRINTER FONT 'Arial',12 STYLE "B"
@ 3,93 say '_____'

SET PRINTER FONT 'Arial',12
@ 4,10  SAY 'Page 1' 
@ 4,75 SAY 'Bill Date:    01/01/1980'

@ 10,19 SAY 'Homer Simpson'
@ 11,19 SAY '59 Evergreen Terrace'
@ 12,19 SAY 'Springfield'

EJECT


SET PRINTER TO
SET PRINT OFF
SET DEVICE TO SCREEN

RETURN

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Thu Aug 24 2006

Hello,

I didn't get your e-mail. did you send it to me or to the Technical Support department?

I guess it would be better if we resolve this issue by e-mail or over the phone because it is hard to resolve it in the forum without having any samples.

Yes the Merge fuction exists in 2.10 and is working properly, but if you have a document with embeded characters or embeded unicode characters it may work in older 2.10.

I will need to check your documents to see what exactly the situation is. Please send us your phone number to support@amyuni.com and i will call you.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Thu Aug 24 2006

I sent it to your e-mail address that I got from your profile here.

I'm sending the contact info now.

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Thu Aug 24 2006

Hello,

I just received your e-mail i will check it and get back to you shortly.

Thanks.

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Thu Aug 24 2006

Thank you very much.

It's quitting time here and I have to go but I look forward to hearing from you tomorrow.

Thanks again,
Chris

cj
Posts: 17
Joined: Tue Aug 15 2006

Post by cj » Thu Aug 31 2006

For anyone reading this, we upgraded to Amyuni PDF Converter 2.51 and it does not have this problem.

Post Reply