We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with PDF height

Thread ID:





116942 Jul 7,2014 01:42 PM UTC Jul 8,2014 09:50 AM UTC WinForms 1
Tags: PDF
Luca Cavicchioli
Asked On July 7, 2014 01:42 PM UTC

Hello, I've got a problem creating a PDF with certain heights in the PdfPageSetting:
Setting an height between 215 and 236, when I try to load the generated PDF in the viewer, an exception is raised: 
System.Collections.Generic.KeyNotFoudException {"The given key was not present in the dictionary."}
Using  any other heights it works like a charm.
Unfortunately I need exactly that height because I've got labels of 80mm  * [mm2Inch conversion factor] * [72dpi] = 226!!
Below you can find the code snippet.

Any suggestion? I need this component to work as soon as possible! 
Thak you
    Luca Cavicchioli

var document = new PdfDocument
//PageSettings = new PdfPageSettings(new SizeF(docWidth, docHeight), 0f)
PageSettings = new PdfPageSettings(new SizeF(283, 226), 0f) // <= HERE IS THE PROBLEM

//Add a new page to the document.
PdfPage page = document.Pages.Add();

//Create Pdf graphics surface for the page
PdfGraphics pdfSurface = page.Graphics;

// --- Drawing something on the surface... but not necessary to reproduce the bug exposed ---
//var drawer = new Drawer.Drawer(true);
//drawer.DrawCanvas(_etichetta, pdfSurface);

Stream pdfStream = new MemoryStream();
var doc = new PdfLoadedDocument(pdfStream);
pdfViewerControl.Load(doc); // <= HERE WHERE THE ERROR IS RAISED

Uthistran S [Syncfusion]
Replied On July 8, 2014 09:50 AM UTC

Hi Luca,

Thank you for your update.

We have tried your code snippet in a simple sample in our Latest Essential Studio version ( and we are unable to reproduce the exception.

Attached the sample for your reference.

Attachment: PdfViewerSample.zip

Could you please, provide us the detail of the Essential studio version installed in your machine? That would help us for further investigation. Else, modify the attached sample to reproduce the issue in our side.

Please, let us know if you need any further assistance.


Uthistran S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon