Click here to Skip to main content
15,914,416 members
Home / Discussions / C#
   

C#

 
AnswerRe: Existance pointers in c# Pin
Anandkumar Prajapati24-Oct-19 22:08
professionalAnandkumar Prajapati24-Oct-19 22:08 
Questionbetter way to serialize a DataView, exclusive of filtered rows ? Pin
BillWoodruff15-Oct-19 21:16
professionalBillWoodruff15-Oct-19 21:16 
AnswerRe: better way to serialize a DataView, exclusive of filtered rows ? Pin
Richard Deeming16-Oct-19 7:57
mveRichard Deeming16-Oct-19 7:57 
GeneralRe: better way to serialize a DataView, exclusive of filtered rows ? Pin
BillWoodruff16-Oct-19 14:45
professionalBillWoodruff16-Oct-19 14:45 
Questionextract pdf images Pin
Member 774487114-Oct-19 23:58
Member 774487114-Oct-19 23:58 
AnswerRe: extract pdf images Pin
Luc Pattyn15-Oct-19 0:15
sitebuilderLuc Pattyn15-Oct-19 0:15 
GeneralRe: extract pdf images Pin
Member 774487115-Oct-19 2:34
Member 774487115-Oct-19 2:34 
GeneralRe: extract pdf images Pin
Luc Pattyn15-Oct-19 2:57
sitebuilderLuc Pattyn15-Oct-19 2:57 
Ghostscript can be ran in a separate process; it takes parameters from its command line. It is one of the many programs that explain their parameters by running it with a /h, -h or -help argument in a command window.

Here is a method I once used, you would have to adapt it to your needs of course.

using System.Diagnostics;
using System.IO;
...
string toolsFolder=@"...";
...
private Bitmap getPngImageFromPDF(int resolution, int pageNumber, string pageName, string inName) {
	string args=" -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dTextAlphaBits=4 "+
	    "-r" + resolution + " -sPageList=" + pageNumber + " -sOutputFile=" + pageName + " " + inName;
	string cmd=Path.Combine(toolsFolder, "gswin32c.exe");
	ProcessStartInfo psi=new ProcessStartInfo(cmd, args);
	psi.CreateNoWindow=true;
	if (!withDebug) psi.WindowStyle=System.Diagnostics.ProcessWindowStyle.Hidden;
	Process proc=Process.Start(psi);
	proc.WaitForExit();
	Bitmap bm=(Bitmap)Image.FromFile(pageName);
	return bm;
}


Notes:
1. pageName is the name of the file that will be generated by ghostscript.
2. the generated file will be locked as long as the generated bitmap is alive.
3. you should Dispose() of the bitmap when you no longer need it.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: extract pdf images Pin
Member 774487115-Oct-19 9:20
Member 774487115-Oct-19 9:20 
GeneralRe: extract pdf images Pin
Luc Pattyn15-Oct-19 12:01
sitebuilderLuc Pattyn15-Oct-19 12:01 
QuestionHow to drag with mouse Controls groupBox1 in Run time ? Pin
Member 245846714-Oct-19 23:05
Member 245846714-Oct-19 23:05 
AnswerRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Richard MacCutchan14-Oct-19 23:43
mveRichard MacCutchan14-Oct-19 23:43 
GeneralRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Member 245846716-Oct-19 16:07
Member 245846716-Oct-19 16:07 
GeneralRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Richard MacCutchan16-Oct-19 21:56
mveRichard MacCutchan16-Oct-19 21:56 
Questionhow to create a text editor that reads c sharp source and display together with colors text and brackets Pin
Member 1462267414-Oct-19 21:35
Member 1462267414-Oct-19 21:35 
AnswerRe: how to create a text editor that reads c sharp source and display together with colors text and brackets Pin
OriginalGriff14-Oct-19 21:46
mveOriginalGriff14-Oct-19 21:46 
AnswerRe: how to create a text editor that reads c sharp source and display together with colors text and brackets Pin
Eddy Vluggen15-Oct-19 1:25
professionalEddy Vluggen15-Oct-19 1:25 
QuestionSystem.NullReferenceException Pin
Alrzini14-Oct-19 10:09
Alrzini14-Oct-19 10:09 
AnswerRe: System.NullReferenceException Pin
OriginalGriff14-Oct-19 10:16
mveOriginalGriff14-Oct-19 10:16 
QuestionHelp with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 6:35
mniceguy8114-Oct-19 6:35 
AnswerRe: Help with getting Monitors (Screen) information Pin
Dave Kreskowiak14-Oct-19 9:35
mveDave Kreskowiak14-Oct-19 9:35 
GeneralRe: Help with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 10:42
mniceguy8114-Oct-19 10:42 
GeneralRe: Help with getting Monitors (Screen) information Pin
Dave Kreskowiak14-Oct-19 11:54
mveDave Kreskowiak14-Oct-19 11:54 
GeneralRe: Help with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 11:56
mniceguy8114-Oct-19 11:56 
QuestionResize controls at runtime (borderless form) Pin
Member 1407482710-Oct-19 15:42
Member 1407482710-Oct-19 15:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.