Remove document from control

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
zaksoft
Posts: 66
Joined: Fri Feb 20 2004

Remove document from control

Post by zaksoft » Tue Feb 17 2009

I need to remove the document from the control, I have a list of document and when the user click on an item the preview is diplayed using pdf.Open( Filename, ""), but sometimes the document is not available or the refreshed list is empty... how can I remove last document from control ?

Thank you in advance.

P.S. loading a document and using pdf.put_ScaleToWindow( acScaleBoth) works but the percentage in not changed accordingly so if you click on the value ( 140% ) the document is zoomed
Davide Zaccanti

David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Remove document from control

Post by David » Wed Feb 25 2009

Hello

You can use the Init blank method. The InitBlank method initializes a blank document.

Hope that helps
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php

zaksoft
Posts: 66
Joined: Fri Feb 20 2004

Re: Remove document from control

Post by zaksoft » Wed Feb 25 2009

Thank, I'll try this

2 related problems:

1) using the control as a preview: try to create a dialog with a ListControl with some hundreds - in my case this morning 18211- of files and together a 3.03 ActiveX control that is updated every time the selected row is changed.. the flicker is unacceptable and a function that load at the same scale perc without flashing is mandatory in next version

2) if you reduce the horz and vert scale this is not taken in account when loading, if you have a full page control this is not so evident, but with a 120 x 300 pixel area the background is bigger the the image of pdf and is not centered

Thank for your support.
Davide Zaccanti

zaksoft
Posts: 66
Joined: Fri Feb 20 2004

Re: Remove document from control

Post by zaksoft » Wed Feb 25 2009

I've inserted

m_Pdf.InitBlank();

in my C++ program when (for example) the list is cleared so no items are present and no preview is to be shown.

I've stepped into code ( that call InvokeHelper( 0x1c, DISPATCH_METHOD, VT_EMPTY, NULL, NULL) ), a void returning void... so it's trivial, but the previous loaded doc is still there.
Davide Zaccanti

zaksoft
Posts: 66
Joined: Fri Feb 20 2004

Re: Remove document from control

Post by zaksoft » Tue Mar 24 2009

It's more that one moth that I've posted my question... can you please tell me if you have (at least) reproduced the problem ?

You have posted that in march version 3.50 will be released (so within one week), I hope it will be fixed before releasing.

Thanxs
Davide Zaccanti

David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Remove document from control

Post by David » Wed Apr 01 2009

Hello

I was not able to re-produce the issue with using the 3.03 version.

this code works to clear the document from the control:
private void button1_Click(object sender, EventArgs e)
{
pdfCreator1.SetLicenseKey("Amyuni Tech.", "07EFCDAE......");
FileStream fs = new FileStream( @"C:\ADS_DOC.PDF", FileMode.Open );

pdfCreator1.Document.Open( fs, "");
fs.Dispose();
fs = null;
}

private void button2_Click(object sender, EventArgs e)
{
pdfCreator1.Document.InitBlank();
}

If you are still encountering this issue, can you send your sample application to support and they will debug your sample.

Hope that helps.
David
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php

zaksoft
Posts: 66
Joined: Fri Feb 20 2004

Re: Remove document from control

Post by zaksoft » Wed Apr 01 2009

As I wrote above I'm using

m_Pdf.Open( filename, NULL);
and
m_Pdf.InitBlank();

and not

m_Pdf.Document.InitBlank();

(there is no Document interface, do you mean m_Pdf.get_document()->InitBlank(); ?)

Any news about version 4.0 download ?
Davide Zaccanti

Post Reply