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.
Unfortunately, activation email could not send to your email. Please try again.

Problem with PDF height

Thread ID:

Created:

Updated:

Platform:

Replies:

116942 Jul 7,2014 09:42 AM Jul 8,2014 05:50 AM Windows Forms 1
loading
Tags: PDF
Luca Cavicchioli
Asked On July 7, 2014 09:42 AM

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();
document.Save(pdfStream);
document.Close(true);
var doc = new PdfLoadedDocument(pdfStream);
pdfViewerControl.Load(doc); // <= HERE WHERE THE ERROR IS RAISED

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

Hi Luca,

Thank you for your update.

We have tried your code snippet in a simple sample in our Latest Essential Studio version (12.1.0.43) 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.

Thanks,

Uthistran S.


CONFIRMATION

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.

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.

;