0

I have a button added to my list view that opens SP2013 list data into a new InfoPath form using the InfoPath 2013 client. That form then has a button which programmatically exports the form into a PDF document.

I have one user who sets their display to 150%, and as a result the PDF exports with 1/3 of the document cut off. Changing the display back to 100% in Control Panel fixes the issue, but the user wants their display at 150% and doesn't want to have to change it each time they need a PDF. This person is running Windows 7 (Ultimate, I believe, but it could be Professional) 32-bit. I'm able to duplicate the issue, however, on my 64-bit Win7 Pro machine.

This may be a question for the Super User or SE exchanges, not sure. It's not specific to SharePoint, but SP2013 is the platform it's all launching from. The code behind the button does a lot of setting variables and such, but here's the relevant part:

//Do the work -- switch to the PDF view then export it as a PDF file.

Microsoft.Office.InfoPath.View currentView = this.CurrentView;
this.CurrentView.Export(@fileLocation + fileName + ".pdf", ExportFormat.Pdf);

Has anyone run into this issue before, or know of a way to supercede the display setting when exporting an InfoPath form?

Edit: If this question belongs elsewhere, please let me know which SE to put it on. I didn't find anything specific to InfoPath.

  • Can you post a code that programmatically exports the form into PDF? – Aziz Kabyshev Mar 9 '16 at 19:51
  • What is the client OS? Windows 8.1 or older? – Aziz Kabyshev Mar 11 '16 at 21:52
  • @AzizKabyshev - updated question with those details. It's Windows 7. – Omegacron Mar 11 '16 at 22:01
1

In Windows, default 100% scaling corresponds to 96 so-called OS DPI, and 150% gives 144 DPI (see "Writing DPI-Aware Desktop and Win32 Applications" @ MSDN).

Applications that do not account for DPI and do not adjust for the larger font and UI sizes can cause various classes of issues. This section describes the most common categories of issues and shows examples that illustrate them. The categories of high DPI issues include:

  • Clipped UI Elements or Text ...

Also, from that doc:

The formula to calculate the effective resolution is:

Effective Resolution = Physical Resolution / (DPI/96)

So it seems logical why 33% of view pixels are clipped.


What you could do is:

  • If elements of the Infopath view have size set in pixels (px), experiment with setting those to other units - inches or centimeters, or auto
  • Check if that behavior was somehow changed by updates. DPI term is mentioned at least in KB2817430 (SP1 for Office 2013). But it's unlikely, those are more about Infopath interface, not views
  • File this as known issue and do nothing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.