Ditte$2007039
Ditte

03/06/2007 :: 00:49

Registered

Hi,
some times before, I have ask for save changing pdf documents.
Perhaps, I change a pdf document (it´s upside down).
Now I like to save it to have it right at next time.
Is it possible? I´ve not found the right syntax for it.
What instruction is the right?
Thank you for help.

Regards
Dittmar
Loïc$2006306
Loïc

03/08/2007 :: 07:36

Registered

Hi,

I don't understand what you want exactly to do. Can you tell me more precisions with somes line of code ?

Thanks and regards,

Loïc Carrère.
ditte$2007039
ditte

03/09/2007 :: 01:27

Registered

Hallo Loïc,

I like do it.
Sorry we are using vdf12 for writing programs.
I import your activex and use it. Only the syntax is a other.

I´ve tested to find a way.

1. using the clipboard
there are two objects
Object oPicture is a cComcGdPicture
End_Object
Object oViewer is a cComGdViewerCnt
End_Object
...
Get ComDisplayFromPdfFile of oViewer "c:\xxx.pdf" to ival
Get ComRotate90 of oViewer to li_page
Send ComCopy2Clipboard of oViewer
Get ComLoadFromClipboard of oPicture to li_param
Get ComGetPicture of oPicture to vPicture
If (not (IsNullComObject (vPicture))) Begin
Get ComDisplayFromStdPicture of oViewer vPicture to ival
Get ComSaveAsPdf of oPicture "c:\xxx.pdf" to bOk
End

This is a possible way, but the result of xxx.pdf isn´t so good.
If you zoom to 100% it´s ok, but if you zoom it in or out it
will be not so good.
2. using create a new pdf
there are also the two objects
Object oPicture is a cComcGdPicture
End_Object
Object oViewer is a cComGdViewerCnt
End_Object
...
Get ComDisplayFromPdfFile of oViewer "c:\xxx.pdf" to ival
Set ComCurrentpage of oViewer to 1
Get ComRotate90 of oViewer to li_page
Get ComGetNativeImage of oViewer to li_vals
Get ComPictureWidth of oViewer to li_w
Get ComPictureHeight of oViewer to li_h
Get compdfnewpdf of oPicture "c:\new.pdf" "" "" "" "" to bok
Send ComPdfSetMeasurementUnits of oPicture 0
Get ComPdfAddImageFromImageID of oPicture li_vals to
li_llnPdfImageID
Send ComPdfSetPageDimensions of oPicture li_w li_h
Send ComPdfDrawImage of oPicture li_llnPdfImageID 0 0
li_w li_h
Send ComPdfEndPage of oPicture
Send ComPdfSavePdf of oPicture

... a "new.pdf" will be created, the size is more then 0, but
if I like to open it I get the following error message:
There was an error opening this document. This file cannot be opened because is has no pages. I think I´ve not the correct syntax??

3. ?????
The best would be, I open a test.pdf, as sample I like to
send ComRotate90 to it and save it back as test.pdf

Thanks and regards

Dittmar
Loïc$2006306
Loïc

03/12/2007 :: 06:48

Registered

Hi,

You forgot the call the PdfNewpage() method before drawing the image: http://gdpicture.com/references/gdpicturepro/content/cGdPicture-PdfNewPage.html

Best regards,

Loïc Carrère
ditte$2007039
ditte

03/15/2007 :: 15:14

Registered

Hi Loïc,

it´s inside.

...
Get ComPictureHeight of oViewer to li_h
Get compdfnewpdf of oPicture "c:\new.pdf" "" "" "" "" to bok
Send ComPdfSetMeasurementUnits of oPicture 0
...

Regards Dittmar

Loïc$2006306
Loïc

03/16/2007 :: 10:40

Registered

Not!

i think you make confusion between compdfnewpdf and compdfnewpage...

please add a coll to the PdnnewPage after this line:


Send ComPdfSetMeasurementUnits of oPicture 0


Regards,

Loïc Carrère
Ditte$2007039
Ditte

03/18/2007 :: 18:05

Registered

Hi Loïc,

thank you. there wars two thinks wrong.
1. you are right, there was no PdfNewpage() method
2. the PdfAddImageFromImageID() method must be finished prior the call of the PdfNewpage() method .

Now it works.

Thanks Dittmar
back to forum