Skip to main content
Participating Frequently
June 19, 2018
Question

Acrobat DC SDK crash in PDPageDrawContentsToWindow

  • June 19, 2018
  • 3 replies
  • 1730 views

I have inherited an Acrobat plugin which displays 1-n PDF pages in an offline bitmap using PDPageDrawContentsToWindow, in addition to displaying 1 PDF page in the main Acrobat window. The offline bitmap shows imposed output.

This is a Windows only plugin, not targeting Acrobat Reader.

Certain PDF files crash the DC SDK plugin version, but work fine in the Acrobat XI plugin version. Other PDFs are fine in the DC SDK plugin. The crash is always in PDPageDrawContentsToWindow. There is no consistency as to whether the 1st or n-th page rendered to the offline bitmap crashes PDPageDrawContentsToWindow.

In all cases, the PDF page displays fine in the main Acrobat window and there is no indication the PDFs are corrupt (Acrobat does not ask to save the files, syntax preflighting passes, etc.)

I have looked at the "What's new" document, but there doesn't seem to be significant changes from XI SDK to DC SDK.

I have changed the plugin to wait for the AVPageViewDidDraw notification before starting to use PDPageDrawContentsToWindow, but the behavior did not improve.

Does anyone have any suggestions as to where to look?

The PDFs causing the crash have some large images (e.g. 6000x2400, 5400x3700) and some are part of transparency regions - but that is about the extent of the 'common thread' between them.

This topic has been closed for replies.

3 replies

Legend
June 20, 2018

Looks like that will work. Won't be useful for me to analyze unfortunately.

Legend
June 20, 2018

You can't insert PDF files as images anyway...you need to share it some other way and post the URL. Remember this is a public forum.

Participating Frequently
June 20, 2018

Can you see this?

meter.pdf - Google Drive

lrosenth
Adobe Employee
Adobe Employee
June 20, 2018

Yes, thanks!

I am not using your exact parameters (and not in your exact calling sequence, of course) – but I have no problem rendering all pages of that PDF to a raster using the current version of Acrobat DC (Windows). It may not impact you, but the PDPageDrawContentsToWindow has been deprecated since it doesn’t work on Mac OS any longer. You want to consider rasterizing it to a bitmap/raster and then blitting that yourself into a window…

lrosenth
Adobe Employee
Adobe Employee
June 19, 2018

Are you bracketing the calls with DURING/HANDLER blocks? I wonder if this is an exception being thrown that you are not catching vs. an actual crash in our code…

Participating Frequently
June 20, 2018

Hi,

Thanks for the reply. I will investigate that, but allow me to emphasize that the code, as is, runs without crashes with the Acrobat XI SDK.

So my first reaction is that something in the SDK has changed (and I am unable to figure out what from the documentation).

lrosenth
Adobe Employee
Adobe Employee
June 20, 2018

Sure, the code in Acrobat has changed. What is going on in this case, can’t tell without a file.

If you want to post the file that is causing problems, we can investigate…