Print Page | Close Window

LoadFromCanvasDC

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1455
Printed Date: 31 Oct 25 at 1:26AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: LoadFromCanvasDC
Posted By: Jan
Subject: LoadFromCanvasDC
Date Posted: 24 May 10 at 1:21PM
Hi,
let me ask:
Is any way to use another canvasDC than canvas create with  GetCanvasDC?
I have a program for printing. I use GDI+ from .NET.
From this same data I can generate a PDF file using command from PDF library with another program.
If had been able use a PaintEventArgs.Graphics (exactly PaintEventArgs.Graphics.GetHdc()) as a canvas instead of GetCanvasDC - I could have only one  program.
Thanks!
Jan
 



Replies:
Posted By: mulfycrowh
Date Posted: 29 May 10 at 6:50AM
Hi !
 
 
Before purchasing the library, I would like to render a PDF file on the screen.
I have been building my project under VC++ and DirectX.
I asked many questions to know how to render under DirectX.
I was told by technical support it would be better to use GDI+.
Well, I am trying to do so.
Do you have any sample under GDI+ ?
 
 
Many Thanks  !


Posted By: Jan
Date Posted: 31 May 10 at 7:50AM
Hi!
I make only one attempt to rendering PDF on screen with Quick PDF library.
I easy overwrite Form1.OnPanit procedure.
This is not correct using rendering, this only show me, that rendering with library is possible.
 

protected override void OnPaint(PaintEventArgs e)

{

Graphics g = e.Graphics;

/* Rendering with s QuickPDF */

string fileName = @"c:\temp\file_to_render.pdf";

string fileVystup = @"c:\temp\fromQuickPDF.pdf";

string licenseKey = "<your licence key>";

int vysledek;

int FileHandle;

// Create the library. A blank document is automatically created at this point

PDFLibrary qp = new PDFLibrary("C:\\Program Files\\Quick PDF Library\\DLL\\QuickPDFDLL0719.dll");

// Unlock the library

qp.UnlockKey(licenseKey);

// Check to see if the library has been successfully unlocked

if (qp.Unlocked() == 1)

{

// open file

FileHandle = qp.DAOpenFileReadOnly(fileName, "");

// rendering file

vysledek = qp.DARenderPageToDC(FileHandle, qp.DAFindPage(FileHandle, 1), 100, g.GetHdc().ToInt32());

}
 
 
 


Posted By: Jan
Date Posted: 31 May 10 at 7:59AM
May be, that I wrong understand what you want...
When you ask for rendering graphics using GDI+ , that my answer is no.
Every my attempt to render graphics with GDI+ and than save it as PDF fault.
I have only example with make grafics using gdi32.dll library and then save this to PDF file using

LoadFromCanvasDC and SaveToFile.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk