how to save pdf file in folder without save dialog c# windows applicationHow do I get the path of the assembly the code is in?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I save a stream to a file in C#?How to save application settings in a Windows Forms Application?Creating pdf files at runtime in c#How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How to delete all files and folders in a directory?c# open file with default application and parametersLink to open a PDF file that's saved in a folder?How to save a pdf as an object in c#

What is a precise issue with allowing getters?

Should I simplify my writing in a foreign country?

Where are the "shires" in the UK?

Is disk brake effectiveness mitigated by tyres losing traction under strong braking?

Can the Tidal Wave spell trigger a vampire's weakness to running water?

Looking for sci-fi book based on Hinduism/Buddhism

Hostile Divisor Numbers

Would a "Permanence" spell in 5e be overpowered?

Counting the Number of Real Roots of A Polynomial

How to preserve a rare version of a book?

Why is my arithmetic with a long long int behaving this way?

Switch Function Not working Properly

How to pass hash as password to ssh server

Is the book wrong about the Nyquist Sampling Criterion?

As black, how should one respond to 4. Qe2 by white in the Russian Game, Damiano Variation?

Copy previous line to current line from text file

Madam I m Adam..please don’t get mad..you will no longer be prime

Drawing an hexagonal cone in TikZ 2D

Clarification of algebra in moment generating functions

Who filmed the Apollo 11 trans-lunar injection?

Why is "breaking the mould" positively connoted?

Is there a word for food that's gone 'bad', but is still edible?

If an old FIN is delivered, will TCP terminate the new connection?

In linear regression why does regularisation penalise the parameter values as well?



how to save pdf file in folder without save dialog c# windows application


How do I get the path of the assembly the code is in?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I save a stream to a file in C#?How to save application settings in a Windows Forms Application?Creating pdf files at runtime in c#How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How to delete all files and folders in a directory?c# open file with default application and parametersLink to open a PDF file that's saved in a folder?How to save a pdf as an object in c#






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"



List<string> pdfFiles = new List<string>();

OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";

if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);










share|improve this question
























  • But you never open any files. Do you just want to copy the files?

    – FalcoGer
    Mar 23 at 11:02

















0















This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"



List<string> pdfFiles = new List<string>();

OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";

if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);










share|improve this question
























  • But you never open any files. Do you just want to copy the files?

    – FalcoGer
    Mar 23 at 11:02













0












0








0








This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"



List<string> pdfFiles = new List<string>();

OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";

if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);










share|improve this question
















This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"



List<string> pdfFiles = new List<string>();

OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";

if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);







c#






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 10:15









Ameen

8151821




8151821










asked Mar 23 at 3:12









Roshan AbrewRoshan Abrew

41




41












  • But you never open any files. Do you just want to copy the files?

    – FalcoGer
    Mar 23 at 11:02

















  • But you never open any files. Do you just want to copy the files?

    – FalcoGer
    Mar 23 at 11:02
















But you never open any files. Do you just want to copy the files?

– FalcoGer
Mar 23 at 11:02





But you never open any files. Do you just want to copy the files?

– FalcoGer
Mar 23 at 11:02












2 Answers
2






active

oldest

votes


















1














You can use the File.Copy method to copy the file to its new location.



First, obtain the path of the file in the old location and desired new location.
Then, apply this method.



File.Copy(@"C:old.txt", @"C:new.txt");





share|improve this answer

























  • Thanks, now it is working

    – Roshan Abrew
    Mar 27 at 10:23


















1














try this



add this Reference file - iTextSharp.text.pdf



 string Folderpath ="your path";

using (FileStream stream = new FileStream(Folderpath, FileMode.Create))

Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();

// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);

pdfDoc.Close();
stream.Close();









share|improve this answer























  • Thanks bro, i got idea from your code...

    – Roshan Abrew
    Mar 27 at 10:23











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310255%2fhow-to-save-pdf-file-in-folder-without-save-dialog-c-sharp-windows-application%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You can use the File.Copy method to copy the file to its new location.



First, obtain the path of the file in the old location and desired new location.
Then, apply this method.



File.Copy(@"C:old.txt", @"C:new.txt");





share|improve this answer

























  • Thanks, now it is working

    – Roshan Abrew
    Mar 27 at 10:23















1














You can use the File.Copy method to copy the file to its new location.



First, obtain the path of the file in the old location and desired new location.
Then, apply this method.



File.Copy(@"C:old.txt", @"C:new.txt");





share|improve this answer

























  • Thanks, now it is working

    – Roshan Abrew
    Mar 27 at 10:23













1












1








1







You can use the File.Copy method to copy the file to its new location.



First, obtain the path of the file in the old location and desired new location.
Then, apply this method.



File.Copy(@"C:old.txt", @"C:new.txt");





share|improve this answer















You can use the File.Copy method to copy the file to its new location.



First, obtain the path of the file in the old location and desired new location.
Then, apply this method.



File.Copy(@"C:old.txt", @"C:new.txt");






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 23 at 4:10









Andy Ng

191




191










answered Mar 23 at 3:16









Thivanka SaranathaThivanka Saranatha

1627




1627












  • Thanks, now it is working

    – Roshan Abrew
    Mar 27 at 10:23

















  • Thanks, now it is working

    – Roshan Abrew
    Mar 27 at 10:23
















Thanks, now it is working

– Roshan Abrew
Mar 27 at 10:23





Thanks, now it is working

– Roshan Abrew
Mar 27 at 10:23













1














try this



add this Reference file - iTextSharp.text.pdf



 string Folderpath ="your path";

using (FileStream stream = new FileStream(Folderpath, FileMode.Create))

Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();

// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);

pdfDoc.Close();
stream.Close();









share|improve this answer























  • Thanks bro, i got idea from your code...

    – Roshan Abrew
    Mar 27 at 10:23















1














try this



add this Reference file - iTextSharp.text.pdf



 string Folderpath ="your path";

using (FileStream stream = new FileStream(Folderpath, FileMode.Create))

Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();

// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);

pdfDoc.Close();
stream.Close();









share|improve this answer























  • Thanks bro, i got idea from your code...

    – Roshan Abrew
    Mar 27 at 10:23













1












1








1







try this



add this Reference file - iTextSharp.text.pdf



 string Folderpath ="your path";

using (FileStream stream = new FileStream(Folderpath, FileMode.Create))

Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();

// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);

pdfDoc.Close();
stream.Close();









share|improve this answer













try this



add this Reference file - iTextSharp.text.pdf



 string Folderpath ="your path";

using (FileStream stream = new FileStream(Folderpath, FileMode.Create))

Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();

// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);

pdfDoc.Close();
stream.Close();










share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 23 at 5:08









Dhanushka DayawanshaDhanushka Dayawansha

361210




361210












  • Thanks bro, i got idea from your code...

    – Roshan Abrew
    Mar 27 at 10:23

















  • Thanks bro, i got idea from your code...

    – Roshan Abrew
    Mar 27 at 10:23
















Thanks bro, i got idea from your code...

– Roshan Abrew
Mar 27 at 10:23





Thanks bro, i got idea from your code...

– Roshan Abrew
Mar 27 at 10:23

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310255%2fhow-to-save-pdf-file-in-folder-without-save-dialog-c-sharp-windows-application%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현