Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all 2571 articles
Browse latest View live

I cannot get a WindowsForms user control hosted in WPF/C# to show() PDF please help

$
0
0

I have a WPF C# .NET 4.0. solution in VS2010 on Windows 7.   It contains a WPF hosting project and a WindowsFormsControl project where I've created a UserControl that should display an Acrobat CAcroAVDoc object from the Interop.Acrobat SDK com object (latest).

 

The WPF Project contains this code to open a file which actually creates a new WindowsFormsUserControl (PDFViewerControl) that in turns opens the file, the UserControl is then added to a WindowsFormHost object in WPF main form.

 

 

private void OpenFile(FileItem file)
{
if (file.Extension.ToLower() == ".pdf")
{
  System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
  WindowsFormsControls.PDFViewerControl viewer = new WindowsFormsControls.PDFViewerControl();
  viewer.Show();

  Boolean result = viewer.OpenFile(file.Path);
  if (!result)
  {
   MessageBox.Show("Error opening document");
  }

  host.Child = viewer;
  this.pdfViewWpf.Children.Add(host);
  viewer.Show();
}
}

 

The PDFViewerControl OpenFile method contains this code and returns True when opening a PDF document via OpenInWindowEx.

 

public Boolean OpenFile(String filename)
{
CAcroAVDoc doc = Activator.CreateInstance(Type.GetTypeFromProgID("AcroExch.AVDoc")) as CAcroAVDoc;

bool res = doc.OpenInWindowEx(filename, this.Handle.ToInt32(), 2, 1, 0, (short)Acrobat.PDViewMode.PDUseBookmarks, (short)Acrobat.AVZoomType.AVZoomFitWidth, 0, 0, 0);

return res;
}

 

 

Unfortunately though the PDF cannot be seen in WPF Host object.  If I place a LABEL on the windows forms user control, the label will show in WPF.  It seems the OpenInWindowEx is not loading a PDF object onto the user control.  Perhaps I need a resize method and event?

 

I cannot locate any object on the PDFViewerControl user control that resembles a PDF document through debug.

 

Any help/pointers much appreciated.

 

this.Handle.ToInt32() does have a seemingly valid value (ie window handle).

this.pdfViewWpf is a XAML <Grid>

 

Dominic


How to enable/disable annotations and markup tools using c#?

$
0
0

I have created a pdf viewer using c#, and when i open a pdf all the annotations and markup tools are disabled. how will i enable them programmatically using c#? please see the image below.

 

Problem.png

 

thanks in advance

QTP-11 doesn't recognize "AcroExch.AVDoc" object with "Adobe Acrobat 9.0"

$
0
0

Hi Support Team,

 

I worked with Acrobat 7 and have used the same script after installing Acrobat 9 for Automation Testing with QTP for validating pdf. The object "AcroExch.AVDoc" is not getting identified as object while working in QTP-11 in the system/machine which has Acrobat 9 installed, whereas it works well in the machine which has Acrobat 7 installed . So it will be better if two things are known as per my understanding, ie.,

  1. it must have compatibility issue (i need links/wweb-source about the difference between "Adobe Acrobat versions 7 & 9" to assure this) or
  2. installation issue( which can be confirmed if the former question is answered).

 

So i kindly request you to help me out for this scenario.

 

 

Kind Regards,

Vikraman G

Replacing AVDocClose causes I.E. 9 to crash

$
0
0

Hi guys,

I just wanted to bring this to everyone's attention in case someone else runs into the issue. My Reader enabled 10 and Acrobat 10 Core API plugins are causing I.E. 9 to crash. The customer browses to a web page that contains links to pdf documents. They click the links and the pdf's are opened in a new tab in I.E. After reading the document, they click the X on the tab. As soon as the tab closes, I.E. crashes.

 

I've reproduced this issue and found that the cause is the AVDocClose replacement. Using a basic plugin with no business logic that replaces AVDocClose causes a crash.

 

I'm going to try to work around this using the AVDocDidClose event instead of AVDocClose.

 

Thanks,

Howie

StartDoc with no save dialog

$
0
0

Hello,

We have a C++ program to print a formatted report, by selecting the configured  printers. "Adobe PDF" printer is available on install of Adobe Acrobat Pro. We are using the trial version.

During report print  when "Adobe PDF" printer is selected, the report use to get printed in a PDF document & saves at the path provided by the User.

Internally it uses printer APIs like StartDoc, StartPage, DrawText, EndPage, etc.

Report printing was working fine with Adobe Acrobat Pro 9.1 and earlier. But since I installed Adobe Acrobat X pro (with update as 10.1.7) I am unable to print PDF document using "Adobe PDF" pinter.

StartDoc API does not pops up the "File Save As" dialog at all.

Here is the code that needs to be fixed:

 

CDC dcPrinter;

dcPrinter.Attach( dc );

 

          //set page dimensions

          CRect rPage;

          rPage = _SetPrintDimensions( &dcPrinter );

 

 

          // doc info

          DOCINFO docinfo;

          memset( &docinfo, 0, sizeof(docinfo) );

          docinfo.cbSize = sizeof(docinfo);

 

   CFont *pOldFont = NULL;

   CFont NewFont;

   BOOL bIsNewFont = NewFont.CreatePointFont(105, _T("Arial"), &dcPrinter);  

 

   ASSERT(bIsNewFont);

   if (bIsNewFont)

   {

      pOldFont = dcPrinter.SelectObject(&NewFont);

      ASSERT(pOldFont != NULL);

   }

          int iRet = dcPrinter.StartDoc( &docinfo );

  DWORD dw = GetLastError();

 

When this code executes, the returned value of StartDoc is -1 which means the function failed to load the printer driver.

The GetLastError() function returns the system code 122, which means The data area passed to a system call is too small.

When I try to print a second time without closing the application, a crash occurs. The crash never happens the first time.

We need an urgent help on this issue.

Thanks,

Scale Ratio dialog from javascript

$
0
0

I am using the measurement tools and annotations using javascript but am unable to display the scale dialog ration screen to change the scale settings

Periodic Failure of LoadFile

$
0
0

I have a VB.Net Windows application that provides PDF viewing features via the AxAcroPDFLib.AxAcroPDF browser object and its LoadFile method.  A customer who uses this application has reported that once in a while the PDF is NOT displayed and NO error messages are produced.  From what I'm told, the browser window has a totally blank white background when the failure occurs.  When the procedure to display the same PDF is repeated, the PDF is properly displayed in the browser window.

 

Adobe Reader V8.1.4 and Adobe Acrobat Standard V8.1.4 are both installed on the PC where the problem occurs.  I suspect that the LoadFile method may be confused by having both Adobe applications installed on the same PC.  My office software development PC has only Adobe Reader V8.1.4 installed and I have been unable to make the LoadFile method fail on this PC.

 

Has anyone ever seen a periodic LoadFile failure as I have described?  If yes, how did you resolve the problem?

AcroPDF ActiveX component license?

$
0
0

hello,

i want to use the AcroPDF ActiveX component (axAcropdf, acropdflib, axacropdflib) in my windows programm. development environment visual studio 2008 prof.). i wana sell this program. do i need any license for this?

thanks

w.bart.


From a coordinate to a pixel

$
0
0

So every object that is displayed in the PDF has some additional data attached to it. One piece of that data surely must be the coordinates of that object on a page. Let's say that object is a line of text.

 

Now, I have two questions. Which corner of the four of that object is represented by that coordinates?

 

Second one is a bit more complicated. All coordinates are of type float and they are represented in units (1/72 inch, right?). However, to be displayed on screen, they need to be transformed into pixels on screen. I was wandering what are all steps that Acrobat or Reader does in order to achieve this. For example, what if the value ends up not being an integer? Does it round the value or just discard the decimal part? I know part of it depends on the DPI of the screen, eg. for 96 dpi 1 pixel is 0.75 units, but this has proven to be inconsistent in my tests. I want to know which coordinates should I give my object in order to make sure that it's eg. top left corner would be display in exactly one particular pixel relative to the page it's displayed on.

 

Since it seems I'm missing out on something, I'd like to know what are ALL the steps that original coordinates go trought before they end up as a one exact pixel on the screen?

Problem compiling sample plugin with Xcode

$
0
0

Hello all,

 

I'm having a problem compiling a sample plugin from the SDK ("BasicPlugin") using Xcode on Mac OS. Xcode's build error is "Unknown type name 'CursHandle'". The error occurs in two source files: AVExpT.h and SafeResources.h. I can't find any header supplied with the Acrobat SDK that defines the CursHandle type.

 

I'm running Mac OS 10.8.4 and Xcode 4.6.3.

 

The SDK documentation said that the SDK was compatible only with Xcode 2.x; elsewhere in the documentation it said it was compatible with Xcode 3.2 or 3.3. Is this the reason for the above error? It's not possible for me to install the older version of Xcode though, because I'm running OX 10.8, and older versions aren't compatible.

 

I'd be very grateful for any help.

 

Paul

Change in capital to Lower while extracting contents

$
0
0

While extracting contents from PDF Capital Letters are changed to small and a tab space is created between some words . Can you please suggest me how this can be solved. Thank  you in advance. Screen shot 2013-08-12 at 3.02.49 PM.png

Caching in Acrobat Reader

$
0
0

I keep running into an issue with Acrobat Reader.   We use a lot of PDFs on out site and sometimes, when I change one of them anyone who had viewed at file recently sees a cached copy of the old file rather than the updated PDF.  Is there an easy solution to this?

How to Set Field value using javascript?

$
0
0

I have a Field in First Page called 'SO'. I want to populate this field from the field value of SD_ITEMS.DATA.VBELN first row in the each page. Please help me with javascript to set this value.

Adobe Hier View.png

Thank you.

Ranji

can't create AcroExch.App on asp.net

$
0
0

  I got an error: "Can't create ActiveX object" when trying:

 

oAcroApp = CreateObject("AcroExch.App")

 

from asp.net on win server 2003.

The same code works in classic ASP on win server 2003 and in ASP.net on windows 7.

But it doesn't work on asp.net on win server 2003. Maybe it is something connected with security permissions on IIS or on the server..

Can somebody give  me a hand?

Could not load file or assembly Interop.Acrobat

$
0
0

All, After I installl the free version of Acrobat reader 11.0.3 , I was trying to run the asp.net samples project in the Acrobat SDK, the project is built successfully, But when It started to run ,I got a exception says "Could not load file or assembly 'Interop.Acrobat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.", My OS system is windows 7 64bit,

I don't know if I missing something, if there exist , please kindly help me . thanks.


Why are signatures created by digital signature plugins, removable?

$
0
0

Hi,

 

I have a digital signature plugin for signing and verification. The signatuers created by this plugin can be cleared/removed on any machine (other than the one on which it was created) on which the signer certificate is not installed.

 

Steps of reproduction:

1. sign one pdf with default Acrobat plugin.

2. sign another pdf with our digital signature plugin.

3. on another machine where the signer certificate is not installed, and our plugin is installed, open both pdfs and try to remove the signatures in them.

4. result: Pdf signed by default acrobat plugin does not allow clearing of signature, where as, pdf signed by our plugin is still removeable.

 

What is it that i am missing here? How can I make my signatures act similar to the ones created by default acrobat plugin?

 

Thanks

 

Untitled.png

 

P.S: I see that locking a field is a possibility, however, the acrobat signed pdf does not have any lock in it and yet it doesn't allow removal of signatures.

From the attached screen shot please note that the left most PDF is signed by our plugin and the middle one is signed by adobe's default plugin without locking, still both behave differently under our custom plugin. Please note also, that if our plugin is not installed, the behavior is same for both pdfs.

 

Message was edited by: shagidelic

Custom URL links in PDF don’t work.

$
0
0

I have registered custom xyz: protocol handler in Windows.

Creating a hyperlink in MS Word and clicking it works OK – my handler app gets invoked.

Saving Word document as PDF used to work (somewhat – by passing URL to the default browser).
Recently it stopped working altogether.

Questions: where should I look for recent changes? In registry? Some configuration / setting in Adobe Reader UI?

And most importantly – can I create a hyperlink  to my custom protocol that will NOT involve the default browser (as Chrome, for example, gets lost)?

How do I catch exception in AxAcroPDFLib?

$
0
0

How do I work around the following fatal error:  AccessViolationException

Steps to reproduce the error:

1. MS VisualStudio 2010

2. Create a UserControl, Add a Button components to the form.

3. Add a Reference to the Acrobat COM component for AxAcroPDFLib

4. Run the application, ax.LoadFile(@"c:\test.pdf");

5. Click the Button

    private void button1_Click(object sender, EventArgs e)

    {

          axAcroPDF1.setCurrentPage(int.Parse(strPageNo));

    }

6. Repeatedly Click

 

 

When to call several times in the function "setCurrentPage", Error is happened, the program is down. And The Program can't Catch Exception.(Access violation)

When the error is generated from the LibAxAcroPDF as described above, Can I Catch Exception in the program?

 

 

Platform:

Windows 7, 32bit

Adobe Reader 9 (9.4.6)

Microsoft Visual Studio 2010 Professional

SnippetRunner Sample

$
0
0

Greetings, I'm trying to get the snippetrunner sample working on windows, but I can't find the project folder specific for windows platform that contains .vcproj

Can't make work SetExportValues method

$
0
0

trying to assign new values to radiobutton in Vbscript, but get a mistake:

"Invalid call procedure or argument"

Can't figure out what's the problem.

 

Set field =Form1.Fields("Radio")

Dim arrExportVal(1)

          arrExportVal(0)="Left"

          arrExportVal(1)="Right"

   field.SetExportValues arrExportVal

 

Thanks

Viewing all 2571 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>