How to use PDF Viewer in ASP.NET application
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
How to use PDF Viewer in ASP.NET application
Hi All,
i am new to PDF XChange Pro SDK and PDF XChange Viewer SDK.
i have installed PDF XChange Pro SDK in my system and i found examples like PDFXCDemo_asp_net and XCProDemo_aspnet. when i am trying to run the applications
for XCProDemo_aspnet application i am getting Unable to load DLL 'xcpro40': The specified module could not be found. error and
for PDFXCDemo_asp_net i am getting Unable to load DLL 'pxclib40': The specified module could not be found. error and it is occuring at
if (Common.IS_DS_FAILED(PDFXC_Funcs.PXC_NewDocument(out pdf, "<YOUR REG KEY>", "<YOUR DEV CODE>"))) statement in the code.
i have placed these dlls in bin folder of the project and in main folder, where web page exists. but the result is same.
i am using windows XP SP2 32bit system with Visual studio 2008.
please help me in this regard.
thanks in advance.
Murali
i am new to PDF XChange Pro SDK and PDF XChange Viewer SDK.
i have installed PDF XChange Pro SDK in my system and i found examples like PDFXCDemo_asp_net and XCProDemo_aspnet. when i am trying to run the applications
for XCProDemo_aspnet application i am getting Unable to load DLL 'xcpro40': The specified module could not be found. error and
for PDFXCDemo_asp_net i am getting Unable to load DLL 'pxclib40': The specified module could not be found. error and it is occuring at
if (Common.IS_DS_FAILED(PDFXC_Funcs.PXC_NewDocument(out pdf, "<YOUR REG KEY>", "<YOUR DEV CODE>"))) statement in the code.
i have placed these dlls in bin folder of the project and in main folder, where web page exists. but the result is same.
i am using windows XP SP2 32bit system with Visual studio 2008.
please help me in this regard.
thanks in advance.
Murali
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 3586
- Joined: Thu Jul 08, 2004 10:36 pm
Re: How to use PDF Viewer in ASP.NET application
When you installed the SDK you should have a folder called bin with all these .dll files. To launch your application which uses any of these DLLs, you need to copy them into the folder where your application is located, or into any folder which is listed in PATH environment variable; or add the folder where these .dll are into the PATH environment variable.
PDF-XChange Co Ltd. (Project Director)
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi Ivan,
Thanks for the reply. i have tried what you said. its working well for windows application. but asp.net application i copoed all the dlls to applicaiton path and also to bin folder of web application. nothing worked for me.
please guide me to correct direction.
regards,
murali.
Thanks for the reply. i have tried what you said. its working well for windows application. but asp.net application i copoed all the dlls to applicaiton path and also to bin folder of web application. nothing worked for me.
please guide me to correct direction.
regards,
murali.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: How to use PDF Viewer in ASP.NET application
I would suggest you add the dll's to a location that exists in your Windows System variable's to be sure the location is valid - or add your desired location to the Windows System Variables, I am not familiar with ASP sufficiently to be able to explain/understand why the application location does not exist unless there is some redirect internally that resets the location - and therefore the system variables location would be the best solution I believe and for your end users - perhaps best to use one that you know will already exist.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
thanks for the reply.
as you said i added the pat of the bin folder(Pro SDK's) in Path environment variable. the result is same.
there are two Asp.net examples in PDF XChange Pro SDK. but there is no example in Viewer SDK. examples are only for windows applications.
i want to develop a new web application with pdfviewer in it, what are the steps to be followed to achive it. i got it in windows application. i am able add pdf viewer control to visual studio toolbox and able to use it. but how can add viewer control in asp.net page and how can show pdf in it.
thanks in advance.
thanks for the reply.
as you said i added the pat of the bin folder(Pro SDK's) in Path environment variable. the result is same.
there are two Asp.net examples in PDF XChange Pro SDK. but there is no example in Viewer SDK. examples are only for windows applications.
i want to develop a new web application with pdfviewer in it, what are the steps to be followed to achive it. i got it in windows application. i am able add pdf viewer control to visual studio toolbox and able to use it. but how can add viewer control in asp.net page and how can show pdf in it.
thanks in advance.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello Murali,
I have just sent you in an e-mail a web app sample in ASP.NET with our AX.
I hope this would help you set everything up.
Best,
Stefan
I have just sent you in an e-mail a web app sample in ASP.NET with our AX.
I hope this would help you set everything up.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi Stefan,
Example you sent helped me.
thank you very much.
i have few doubts about the class id of the object and viewer control. i have searched in my registry for viewer key and found. but when i used that classid in the application, viewer is not loading. with the key you provided, every thing is working fine. what could be the reason?
one more thing is i have placed the viewer object(<object> tag)with classid given by you in html table. when i run that page, viewer is not loading. if it is out of the table its loading. is there any reason?? why because if the controls left without table then alignment will change based on the screen resolution.
Thanks & Regards,
Muralidhar.
Example you sent helped me.
thank you very much.
i have few doubts about the class id of the object and viewer control. i have searched in my registry for viewer key and found. but when i used that classid in the application, viewer is not loading. with the key you provided, every thing is working fine. what could be the reason?
one more thing is i have placed the viewer object(<object> tag)with classid given by you in html table. when i run that page, viewer is not loading. if it is out of the table its loading. is there any reason?? why because if the controls left without table then alignment will change based on the screen resolution.
Thanks & Regards,
Muralidhar.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello Muralidhar,
The "FE36F0F3-..." CLSID is the one for the Viewer AX Control.
You probably initially found the CLDID for another of our products?
As for why it is not working in your page - I can just guess, but please check you JS and the way you are embedding the object
Also you could achieve alignment using divisions instead of tables.
Best,
Stefan
The "FE36F0F3-..." CLSID is the one for the Viewer AX Control.
You probably initially found the CLDID for another of our products?
As for why it is not working in your page - I can just guess, but please check you JS and the way you are embedding the object
Also you could achieve alignment using divisions instead of tables.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi Stefan,
can you please send sample for viewer applicaiton in asp.net with all commands like
(i need commands with javascript syntax for )
open document from stream
save document in server path
save document from stream
export
import
find
search etc.
or can you please suggest where can i get the complete reference for javascript commands.
can we perform viewer commands from code behind??
thanks & regards,
Muralidhar.
can you please send sample for viewer applicaiton in asp.net with all commands like
(i need commands with javascript syntax for )
open document from stream
save document in server path
save document from stream
export
import
find
search etc.
or can you please suggest where can i get the complete reference for javascript commands.
can we perform viewer commands from code behind??
thanks & regards,
Muralidhar.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
Have a look at the btnToolbars onclick() function in the sample:
It uses the DoVerb method which is the main method in the library. Other existing methods act as shortcuts to some specific
functionality of this method.
So using DoVerb, and the list of available commands in the AX Manual you can do pretty much anything we offer as functionality in the end user stand alone Viewer.
I would recommend you to have a look at some of the other examples (e.g. the ones in C#) for how to use the open/save/export/import commands and simply translate them to work for your syntax.
Best,
Stefan
Have a look at the btnToolbars onclick() function in the sample:
Code: Select all
function btnToolbars_onclick() {
document.all.PDFView.DoVerb("", "ExecuteCommand", "ToggleAllBars", 0, 0);
}
functionality of this method.
So using DoVerb, and the list of available commands in the AX Manual you can do pretty much anything we offer as functionality in the end user stand alone Viewer.
I would recommend you to have a look at some of the other examples (e.g. the ones in C#) for how to use the open/save/export/import commands and simply translate them to work for your syntax.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi Stefan,
thanks for your help.
i tried with the examples in sdk.
XCProDemo_aspnet demo working fine for me.
but when trying to execute the example PDFXCDemo_asp_net i am getting negative value "-2081161211" at the statement PDFXC_Funcs.PXC_WriteDocumentExA(pdf, fname_local, fname_local.Length, fl, "");
can u please send me an asp.net example with pdf tools.
please send me ASAP. because this is very urgent for me.
regards,
muralidhar.
thanks for your help.
i tried with the examples in sdk.
XCProDemo_aspnet demo working fine for me.
but when trying to execute the example PDFXCDemo_asp_net i am getting negative value "-2081161211" at the statement PDFXC_Funcs.PXC_WriteDocumentExA(pdf, fname_local, fname_local.Length, fl, "");
can u please send me an asp.net example with pdf tools.
please send me ASAP. because this is very urgent for me.
regards,
muralidhar.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
I have asked for help from our devs and will advise what their comments are as soon as they reply.
Best,
Stefan
I have asked for help from our devs and will advise what their comments are as soon as they reply.
Best,
Stefan
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
Hi Muralidhar,
Also there is example of call to this function in PDFXCDemo_asp_net:
-2081161211 error code means that access to file is denied.
Possibly its open already or you dont have permission to access the location concerned ?
You can get a description of any received error by using GetDSErrorString."-2081161211" at the statement PDFXC_Funcs.PXC_WriteDocumentExA(pdf, fname_local, fname_local.Length, fl, "");
Also there is example of call to this function in PDFXCDemo_asp_net:
Code: Select all
int ret = PDFXC_Funcs.PXC_WriteDocumentExA(pdf, fname_local, fname_local.Length, fl, "");
if (Common.IS_DS_FAILED(ret))
{
string s = "";
Common.GetDSErrorString(ret, ref s);
}
Possibly its open already or you dont have permission to access the location concerned ?
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
i have loaded pdf document into viewer, and i want to save the same in my server in specific location. how to do that?
please help in this regard.
thanks,
i have loaded pdf document into viewer, and i want to save the same in my server in specific location. how to do that?
please help in this regard.
thanks,
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello Muralidhar,
Using the SaveDocument method ( described in section 2.1.1.2.14 of the manual) you could control where and how to save the document, and whether or not to show the UI save dialogue window and much more.
Best,
Stefan
Using the SaveDocument method ( described in section 2.1.1.2.14 of the manual) you could control where and how to save the document, and whether or not to show the UI save dialogue window and much more.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
i tried as per your instructions. i think it is meant for windows applications.
but, i am using the viewer control in my asp.net application.
when try use the same syntax, its saving the pdf document which loaded in viewer without any prompt. what i mean is i want to show save dialog on button click and let the user to save the document whereever he wants.
one more thing, is it possible to save the same doucment in server(i.e., where my asp.net application is hosted).
how do i get full file name of document in viewer.
all i want to do from javascript only.
it is very urgent requirement for me.
please help me in this regard.
i tried as per your instructions. i think it is meant for windows applications.
but, i am using the viewer control in my asp.net application.
when try use the same syntax, its saving the pdf document which loaded in viewer without any prompt. what i mean is i want to show save dialog on button click and let the user to save the document whereever he wants.
one more thing, is it possible to save the same doucment in server(i.e., where my asp.net application is hosted).
how do i get full file name of document in viewer.
all i want to do from javascript only.
it is very urgent requirement for me.
please help me in this regard.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello Muralidhar
Taken directly from the manual for the same "SaveDocument" method:
Stefan
Taken directly from the manual for the same "SaveDocument" method:
Cheers,Remarks
Call to save or copy the opened document, specified by ID. To display the standard save file
dialog you should pass NULL to DestFileName. If you want to skip possible error dialogs then
you must specify the PXCVA_Flags::PXCVA_NoUI flag in Flags.
Stefan
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How to use PDF Viewer in ASP.NET application
Hi, muralidhar.
You may obtain the document's file name by:and you may intercept the new named notify about end of saving into stream/file:
Note: code samples are in preudocode format.
HTH.
You may obtain the document's file name by:
Code: Select all
string s;
ctrl.GetDocumentProperty(docId, "FileName", out s, 0);
Code: Select all
eventhandler OnEvent(type, name...)
{
if ((type == PXCVA_OnNamedNotify) AND (name == "Notifications.DocSaved"))
{
// upload the data from stream or file to the remote server
}
}
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi Vasyl,
thanks for the reply.
i think its the c# syntax and can be used in windows application.
but, i want to know the command to get file name which is loaded in viewer .
and one more thing, i want to save the same file(which is loaded in viewer) on my server.
if you can provide a sample code or application, that will be very helpful for me.
how to do that?
please help me. it is very urgent requirement.
thanks for the reply.
i think its the c# syntax and can be used in windows application.
but, i want to know the command to get file name which is loaded in viewer .
and one more thing, i want to save the same file(which is loaded in viewer) on my server.
if you can provide a sample code or application, that will be very helpful for me.
how to do that?
please help me. it is very urgent requirement.
Regards,
Muralidhar.
Muralidhar.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
Here is a sample of how you can get document file name in JS:
HTH.
Here is a sample of how you can get document file name in JS:
Code: Select all
var activeDocId = document.all.PDFView.Property("Documents.Active", 0);
var s = document.all.PDFView.Property("Documents[#" + activeDocId + "].FileName", 0);
alert(s);
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
thanks for the reply.
can you provide sample code for converting word document and excel files to pdf.
and please let me know where can i get the complete reference for set and get properties of the viewer using javascript.
is there any direct method to save the file to server, like http post, from viewer.
please help me in this regard.
thanks,
thanks for the reply.
can you provide sample code for converting word document and excel files to pdf.
and please let me know where can i get the complete reference for set and get properties of the viewer using javascript.
is there any direct method to save the file to server, like http post, from viewer.
please help me in this regard.
thanks,
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
Best,
Stefan
I am sorry but the Viewer can not do such a conversion. You will need to use our Drivers API SDK, and pass a print command to Word or Excel, to make them "print" to our printing driver, in order to "convert" an Office document to PDF.Can you provide sample code for converting word document and excel files to pdf?
http://www.adobe.com/content/dam/Adobe/ ... erence.pdfand please let me know where can i get the complete reference for set and get properties of the viewer using javascript.
If your application is on an end user machine, you will need to save the document to file or stream, and post it yourself, or if your application is run on the server directly you should be able to save the documents with ease as well.Is there any direct method to save the file to server, like http post, from viewer.
Best,
Stefan
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: How to use PDF Viewer in ASP.NET application
Hi, muralidhar.
HTH
Please look to our SDK help - all available properties/methods are decribed. Some examples (like as above):and please let me know where can i get the complete reference for set and get properties of the viewer using javascript.
Code: Select all
// get
var activeDocId = document.all.PDFView.Property("Documents.Active", 0);
var s = document.all.PDFView.Property("Documents[#" + activeDocId + "].FileName", 0);
// set
document.all.PDFView.Property("General.AllowAllAccelerators") = 1;
document.all.PDFView.Property('View.Bars["File"].Visible') = 0; // hide "File" toolbar
document.all.PDFView.SetDocumentProperty(activeDocId, 'Pages.ZoomMode') = "Percent"; // switch to zoom in percents
document.all.PDFView.SetDocumentProperty(activeDocId, 'Pages.Zoom') = 200; // 200% pages zoom
...
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
thanks for the reply.
if we have to save the file in the server then we have to use fileupload control in asp.net.
but in some scenarios there may not be a chance to use fileupload. in that case can we get the file details like, file content, file content length, file type etc. here the file means, what ever the pdf file is loaded in viewer.
stefan,
i have downloaded PDF-XChange Drivers API and installed it. there is no examples in c#.
there is nothing related to converting windows files(doc, xsl) files to pdf.
can you please provide a sample application in c# to convert doc & excel files to pdf.
Thanks,
thanks for the reply.
if we have to save the file in the server then we have to use fileupload control in asp.net.
but in some scenarios there may not be a chance to use fileupload. in that case can we get the file details like, file content, file content length, file type etc. here the file means, what ever the pdf file is loaded in viewer.
stefan,
i have downloaded PDF-XChange Drivers API and installed it. there is no examples in c#.
there is nothing related to converting windows files(doc, xsl) files to pdf.
can you please provide a sample application in c# to convert doc & excel files to pdf.
Thanks,
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: How to use PDF Viewer in ASP.NET application
We do not have C# examples at this time for the drivers API - I will request this from our dev team - but this could I am afraid take several days to be available as they are fully committed to working on new releases due in the next few weeks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
ok. if it is not possible to send c# example, could you please provide javascript code sample for the conversion??
this is very urgent for me.
thanks,
ok. if it is not possible to send c# example, could you please provide javascript code sample for the conversion??
this is very urgent for me.
thanks,
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
I believe there already is one included - see the attached ...
I believe there already is one included - see the attached ...
You do not have the required permissions to view the files attached to this post.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
Here is small sample of how to use drivers API in C# HTH
Here is small sample of how to use drivers API in C# HTH
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
John & Corwin thanks alot for the speedy reply.
corwin, i tried to run the application, everything is going smoothly. but i want to do the entire process silently. can we do that without any dialogs and user input(clicks)? because i want to do that in ASP.NET webpage. what is my exact need is if a user select doc/xls, then i want to convert that file into pdf and i will show the resultant pdf in our viewer.
i will try that from my end. if you already have anything like that please send that me.
Jhon, i have installed the driver software and checked the installed examples. i found the same "js" file. but what my doubt is there is no input document name is mentioned. and how to execute this script?? please help me.
once again thanks for the help.
John & Corwin thanks alot for the speedy reply.
corwin, i tried to run the application, everything is going smoothly. but i want to do the entire process silently. can we do that without any dialogs and user input(clicks)? because i want to do that in ASP.NET webpage. what is my exact need is if a user select doc/xls, then i want to convert that file into pdf and i will show the resultant pdf in our viewer.
i will try that from my end. if you already have anything like that please send that me.
Jhon, i have installed the driver software and checked the installed examples. i found the same "js" file. but what my doubt is there is no input document name is mentioned. and how to execute this script?? please help me.
once again thanks for the help.
Regards,
Muralidhar.
Muralidhar.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
For silent printing, you can set next printer options:
More information can be found in PDF-XChange Driver Api SDK Help file.
As I understood, you do not need to use JSExample in your code.
HTH.
For silent printing, you can set next printer options:
Code: Select all
PDFPrinter.Option["Save.File"] = "C:\\sample.pdf";
PDFPrinter.Option["Save.SaveType"] = "Save";
PDFPrinter.Option["Save.ShowSaveDialog"] = "No";
PDFPrinter.Option["Save.WhenExists"] = "Overwrite";
PDFPrinter.Option["Saver.ShowProgress"] = false;
PDFPrinter.Option["Save.RunApp"] = true;
As I understood, you do not need to use JSExample in your code.
HTH.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi all,
i have placed pdfviewer on my web page and displaying a pdf init. pdf is loaded from my website.
every thing is working fine.
what i need is, when the user do some modifications like adding notes, stamps, removing or adding pages etc with the pdf in viewer, then i have to update the original document(which is loaded earlier) with the latest one in my server.
how to achieve that.
need help. it is very urgent.
thanks in advance.
i have placed pdfviewer on my web page and displaying a pdf init. pdf is loaded from my website.
every thing is working fine.
what i need is, when the user do some modifications like adding notes, stamps, removing or adding pages etc with the pdf in viewer, then i have to update the original document(which is loaded earlier) with the latest one in my server.
how to achieve that.
need help. it is very urgent.
thanks in advance.
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
The Viewer SDK will not handle the upload to the server for you, but you can store the modified file to a stream, and then use this stream as a base for an upload to the server which you will need to handle with your own code.
Best,
Stefan
The Viewer SDK will not handle the upload to the server for you, but you can store the modified file to a stream, and then use this stream as a base for an upload to the server which you will need to handle with your own code.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
thank you for the replay.
can i access the viewer in asp.net webpage serverside code?
or can you please tell me how can i get the file's stream from javascript and using that in my serverside code.
thank you for the replay.
can i access the viewer in asp.net webpage serverside code?
or can you please tell me how can i get the file's stream from javascript and using that in my serverside code.
Regards,
Muralidhar.
Muralidhar.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
As I know, there is no appropriate way to do this.muralidhar wrote:can i access the viewer in asp.net webpage serverside code?
I'm afraid, that we do not have any sample code for this.muralidhar wrote:or can you please tell me how can i get the file's stream from javascript and using that in my serverside code.
Best regards
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
could anyone please tell me how to save the document to my server?
many replied to save that using own saving technique. to do that we should know the document and its details like content size, filename etc. without having anything how one can save that document to server.
suggest any approach to achieve this.
thanks in advance.
ps: is viewer to be used in web page only to view the pdf?????????
could anyone please tell me how to save the document to my server?
many replied to save that using own saving technique. to do that we should know the document and its details like content size, filename etc. without having anything how one can save that document to server.
suggest any approach to achieve this.
thanks in advance.
ps: is viewer to be used in web page only to view the pdf?????????

Regards,
Muralidhar.
Muralidhar.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: How to use PDF Viewer in ASP.NET application
Hello
http://msdn.microsoft.com/en-us/library/aa479405.aspx
http://www.codeproject.com/KB/aspnet/fileupload.aspx
HTH.
Using Viewer on web page, you can use all function from stand alone version. But as you already know, current version of Viewer does not support uploading files on server. In this topic you can find example code, of how to get path to document file, which is currently opened in viewer. Using ASP.NET code you can do with this file anything you want, including uploading to server:muralidhar wrote:is viewer to be used in web page only to view the pdf?
http://msdn.microsoft.com/en-us/library/aa479405.aspx
http://www.codeproject.com/KB/aspnet/fileupload.aspx
HTH.
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
i know how to upload files using file upload control.
what i want is, once the file is uploaded from user machine, that will be shown in a list. if user selects one of the item then file is loaded into the viewer from server. upto now everything is fine. but if the user do any modification in the file like adding annotations, stamps or text then those changes has to be updated to the file in server.
to do so, we have to upload the modified file to server and overwrite the existing one.
here we cannot ask the user to again select file upload it. it has to be uploaded/updated without user selection.
can we do that??
i know how to upload files using file upload control.
what i want is, once the file is uploaded from user machine, that will be shown in a list. if user selects one of the item then file is loaded into the viewer from server. upto now everything is fine. but if the user do any modification in the file like adding annotations, stamps or text then those changes has to be updated to the file in server.
to do so, we have to upload the modified file to server and overwrite the existing one.
here we cannot ask the user to again select file upload it. it has to be uploaded/updated without user selection.
can we do that??
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
You need to save the changes to the file. You can keep the saved copy in a stream, and upload the modified file from the stream, so no writing to the hard drive is needed.
Best,
Stefan
You need to save the changes to the file. You can keep the saved copy in a stream, and upload the modified file from the stream, so no writing to the hard drive is needed.
Best,
Stefan
-
- User
- Posts: 46
- Joined: Tue Nov 30, 2010 9:07 am
Re: How to use PDF Viewer in ASP.NET application
Hi,
can you please provide a sample code, how to get the stream and save that to server.
because viewer will be used like object in asp.net, i dont know exactly how to get the stream from viewer.
please help me.
thanks
can you please provide a sample code, how to get the stream and save that to server.
because viewer will be used like object in asp.net, i dont know exactly how to get the stream from viewer.
please help me.
thanks
Regards,
Muralidhar.
Muralidhar.
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello muralidhar,
How to get the stream should already be listed in the manual, and how to upload that to a server is something you need to handle in your application, so sorry but we can not provide you with a sample for that.
Best,
Stefan
How to get the stream should already be listed in the manual, and how to upload that to a server is something you need to handle in your application, so sorry but we can not provide you with a sample for that.
Best,
Stefan
-
- User
- Posts: 2
- Joined: Thu Apr 16, 2015 11:51 pm
Re: How to use PDF Viewer in ASP.NET application
Hi Guys,
As i'm reading the previous replies I noticed some of you is looking on how to implement the PDF Exchange Viewer in ASP. Right now, our project is in MVC asp and as of now we are using the iframe to load the PDF file through the client server. PDF files was automatically loaded in viewer. We want to implement the functionalities of the SDK to save all modified/changes to server to have control on the action of the users. I just want to know how to use the object and how to load it via stream? if you have sample codes that could help me to achieve this i really appreciate it. You can send it here. Thanks
Regards,
BigJRofC
As i'm reading the previous replies I noticed some of you is looking on how to implement the PDF Exchange Viewer in ASP. Right now, our project is in MVC asp and as of now we are using the iframe to load the PDF file through the client server. PDF files was automatically loaded in viewer. We want to implement the functionalities of the SDK to save all modified/changes to server to have control on the action of the users. I just want to know how to use the object and how to load it via stream? if you have sample codes that could help me to achieve this i really appreciate it. You can send it here. Thanks
Regards,
BigJRofC
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: How to use PDF Viewer in ASP.NET application
Hello BigJRofC,
You can set this propertyAnd then work with stream objects directly.
Regards,
Stefan
You can set this property
Code: Select all
SetProperty("Documents.UseStreamsDirectly", 0, 0)
Regards,
Stefan