Click here to Skip to main content
14,392,366 members
   

C#

 
AnswerRe: Existance pointers in c# Pin
Anandkumar Prajapati24-Oct-19 23:08
professionalAnandkumar Prajapati24-Oct-19 23:08 
Questionbetter way to serialize a DataView, exclusive of filtered rows ? Pin
BillWoodruff15-Oct-19 22:16
mveBillWoodruff15-Oct-19 22:16 
AnswerRe: better way to serialize a DataView, exclusive of filtered rows ? Pin
Richard Deeming16-Oct-19 8:57
communityengineerRichard Deeming16-Oct-19 8:57 
GeneralRe: better way to serialize a DataView, exclusive of filtered rows ? Pin
BillWoodruff16-Oct-19 15:45
mveBillWoodruff16-Oct-19 15:45 
Questionextract pdf images Pin
Member 774487115-Oct-19 0:58
MemberMember 774487115-Oct-19 0:58 
AnswerRe: extract pdf images Pin
Luc Pattyn15-Oct-19 1:15
sitebuilderLuc Pattyn15-Oct-19 1:15 
GeneralRe: extract pdf images Pin
Member 774487115-Oct-19 3:34
MemberMember 774487115-Oct-19 3:34 
GeneralRe: extract pdf images Pin
Luc Pattyn15-Oct-19 3:57
sitebuilderLuc Pattyn15-Oct-19 3: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 10:20
MemberMember 774487115-Oct-19 10:20 
GeneralRe: extract pdf images Pin
Luc Pattyn15-Oct-19 13:01
sitebuilderLuc Pattyn15-Oct-19 13:01 
QuestionHow to drag with mouse Controls groupBox1 in Run time ? Pin
Member 245846715-Oct-19 0:05
MemberMember 245846715-Oct-19 0:05 
AnswerRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Richard MacCutchan15-Oct-19 0:43
mveRichard MacCutchan15-Oct-19 0:43 
GeneralRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Member 245846716-Oct-19 17:07
MemberMember 245846716-Oct-19 17:07 
GeneralRe: How to drag with mouse Controls groupBox1 in Run time ? Pin
Richard MacCutchan16-Oct-19 22:56
mveRichard MacCutchan16-Oct-19 22: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 22:35
MemberMember 1462267414-Oct-19 22: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 22:46
mveOriginalGriff14-Oct-19 22: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 2:25
mveEddy Vluggen15-Oct-19 2:25 
QuestionSystem.NullReferenceException Pin
Alrzini14-Oct-19 11:09
MemberAlrzini14-Oct-19 11:09 
AnswerRe: System.NullReferenceException Pin
OriginalGriff14-Oct-19 11:16
mveOriginalGriff14-Oct-19 11:16 
QuestionHelp with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 7:35
Membermniceguy8114-Oct-19 7:35 
AnswerRe: Help with getting Monitors (Screen) information Pin
Dave Kreskowiak14-Oct-19 10:35
mveDave Kreskowiak14-Oct-19 10:35 
GeneralRe: Help with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 11:42
Membermniceguy8114-Oct-19 11:42 
GeneralRe: Help with getting Monitors (Screen) information Pin
Dave Kreskowiak14-Oct-19 12:54
mveDave Kreskowiak14-Oct-19 12:54 
GeneralRe: Help with getting Monitors (Screen) information Pin
mniceguy8114-Oct-19 12:56
Membermniceguy8114-Oct-19 12:56 
QuestionResize controls at runtime (borderless form) Pin
Member 1407482710-Oct-19 16:42
MemberMember 1407482710-Oct-19 16: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.