|
hi all,
This is what i found on the web
public static PdfFileSpecification fileEmbedded(PdfWriter writer,String filePath,String fileDisplay,
byte[] fileStore,int compressionLevel)
{
Parameters:
writer - the PdfWriter
filePath - the file path
fileDisplay - the file information that is presented to the user
fileStore - the byte array with the file. If it is not null
compressionLevel - the compression level to be used for compressing the file it takes precedence over filePath
} <---- what to type inside?
So this help to transfer the html that have been converted to pdf to store inside a file ?
does anyone know how to convert html to pdf using C#?
Cause the web i find are about java
Thank you
|
|
|
|
|
Wrong Forum my dear friend!!!!
|
|
|
|
|
how come?
need help on how to convert using C#
html - pdf
|
|
|
|
|
This is the C++ forum.
There is a C# forum[^].
These are different things.
If you post in the correct forum, you're more likely to have knowledgable people see your question. This is in your own interest.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
sorry... posted on wrong forum
|
|
|
|
|
I saw an article about convert pdf to text here did you see it?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
where to find?
Cause the web i find are about java coding, which i do not know at all
lol
C# coding are limited...
not really know where to find.
|
|
|
|
|
|
Hi to all,
can we change a text(static text) dynamically. I know the name itself says its static. But I ma sure there will be someway to change it in the code, exactly like labels in vb.
could anyone please tell me is there any way to do that in MFC
thanks in advance
I am a beginner
|
|
|
|
|
Hello himangshuS,
1) First change the id of static control from IDC_STATIC to something else like IDC_STATIC_NAME.
2) Get the static control by GetDlgItem() and set text by SetWindowText() .
GetDlgItem( IDC_STATIC_NAME)->SetWindowText( "Hello World" );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Fo work with static controls you always need to set id for them and usually you need to set notify for them(of course here it doesnt need) then you can use of SetWidowText.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: then you can use of SetWidowText.
Like so:
GetDlgItem(IDC_MOURNING)->SetWidowText (L"My husband died, and now I'm sad.")
?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
No your code has a bug!
GetDlgItem(IDC_HAPPY)->SetWidowText (L"My husband is great man and now I'm happy.")
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi,
I want to check whether active windows is desktop or not ? is it possible to check it using GetDesktopWindow(), please give me hint or short example.
thanx
|
|
|
|
|
Use GetActiveWindow() and GetDesktopWindow() and compare if the HWND s returned are the same.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
But GetActiveWindow() fails when I click on tray icon, it returns null
|
|
|
|
|
I am trying to get this program to work. It is only the first part of a Sudoku assignment but everything works until it goes to print out. I try to compile it and get an error when it gets to printing the structure. Help please asap!
#include <stdio.h>
#include <stdlib.h>
struct grid{
int row;
int col;
};
void readArray(struct grid *z);
void printArray(struct grid y);
main(){
struct grid x;
x.row = 0;
x.col = 0;
readArray(&x);
printArray(x);
system ("pause");
return 0;
}
void readArray (struct grid *z){
int i;
int gridRow;
int gridCol;
int area;
z->row = 0;
z->col = 0;
while(z->row <= 0){
printf("Enter the number of rows in each box. Number must be positive.\n");
scanf("%d", &(z->row));
}
while(z->col <= 0){
printf("Enter the number of columns in each box. Number must be positive.\n");
scanf("%d", &(z->col));
}
gridRow = (z->row)*(z->col);
gridCol = gridRow;
area = gridRow * gridCol;
struct grid *xPtr = NULL;
xPtr = (struct grid *)malloc(sizeof(struct grid));
if(xPtr == NULL){
printf("Error, could not allocate enough memory. Exiting program.\n");
exit(-1);
}
printf("Enter numbers you want in the puzzle.\n", area);
for(i=0; i scanf("%d", &((xPtr)[i]));
}
}
void printArray (struct grid y){
int rows;
int cols;
rows = y.row * y.col;
cols = rows;
if((y.row<=0) || (y.col<=0)){
printf("printArray error: one or more of the entered dimensions is less than or equal to zero.\n");
return;
}
int i, j, k;
for(j=0;j<rows;j++){>
if ((j%y.row) == 0){
for(i=0;i<(5*cols+(cols/y.col)+1);i++){
printf("-");
}
printf("\n");
}
for(i=0;i<cols;i++){>
k = j*rows + i;
if ((i%y.col)==0){
printf("|");
}
if(y[k] == 0){
printf(" ");
}
else{
printf("%3d ",y[k]);
}
}
printf("|\n");
}
for(i=0;i<(5*cols+(cols/y.col)+1);i++){
printf("-");
}
printf("\n");
}
</stdlib.h></stdio.h>
|
|
|
|
|
If you want help, you should:
a) shorten the sample code to the offending lines.
b) Edit your answer to show the files you're including. CP can occasionally be a pain.
c) Show what errors you are actually having. We might not get the same errors on our PCs, as we could have different versions of header files / OS's etc.
d) Well done on using the pre tag though! Too many people don't...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
That is good to know for the next time I have problems but I finally figured out what the problem was. Thank you though.
|
|
|
|
|
I am looking at the book, “Windows 95 with MFC” by Jeff Prosise. In this book, there are two techniques for implementing scroll bars given. One approach is to process the messages ON_WM_VSCROLL and ON_WM_HSCROLL. The other approach is to use the class CScrollView.
I am currently using the first approach and I find that my application has the following problem: If I run the program and using the mouse I make the window small (in the horizontal direction) a horizontal scroll bar shows up. This is to be expected. I then use the mouse to move the scroll bar to the middle of the window. Now, I minimize the window and then maximize the window. After doing this, I would expect the text and the input field (of type CEdit) to be drawn aligned on the screen. However, this is not the case. The text is shifted to the right (at least relative to the input field). I do not understand why and I am hoping somebody here can tell me what I am missing.
Do you think switching to CScrollView will solve my problem?
Thanks
Bob
|
|
|
|
|
I think I figured out what I was doing wrong. When the window gets resized, I need to move
the child windows that I have in my application. The way to do this is to use the method
CWnd::MoveWindow.
The window gets moved by the offset of the scrollbar. Does this make sense? What, if any, am I missing?
Thanks
Bob
|
|
|
|
|
Your error will be heavily dependent on the fine detail of your application.
But you need to handle the WM_SIZE message to change the details of your scroll bars.
Have a look at the SCROLLINFO structure, and also the nPage member.
Then you'll want to call GetScrollInfo in your painting routine, so you know to offset your painting by a certain amount.
If you *can* use CScrollView, it does all this work for you. And set's up the DC you draw on to with SetViewportOrg etc so it's invisible for you.
I don't use it, and I do all this scroll bar myself - and there's quite a few things to trip you up.
Reading your message again... I'm not sure where this CEdit is coming in. Maybe you should be using a CFormView, put your controls on a dialog, and letting MFC do all this work instead?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Iain,
Thanks for the response. I have a field of type CEdit defined in the main window class of the application. I will definitely take a look at the class CFormView.
Is there a reason why I might not be able use CScrollView?
Thanks
Bob
|
|
|
|
|
/* IM TRYING TO WRITE IT SO THAT I CAN SEE EACH LETTER AS IT IS BEING WRITTEN BY THE COMPUTER*/
/* Thanks in advance*/
#include <stdio.h>
main()
{
printf("\n\nH");
sleep(2);
printf("e");
sleep(2);
printf("y");
sleep(2);
return 0;
}
/* Im trying to run it one letter at a time*/
modified on Monday, March 9, 2009 8:30 PM
|
|
|
|
|
I think this is what you want:
#include <stdio.h><br />
main()<br />
{<br />
printf("\n\nH");<br />
printf("e"); ;<br />
printf("y");<br />
<br />
printf( "\n" );<br />
return 0;<br />
}
Bob
|
|
|
|