I'm currently working on a project that requires OneNote automation. Now I need to copy images from a page to another. I've found out some APIs on the Microsoft site like GetPageContent, UpdatePageContent to do this. Currently I am manually copy the one:Image Data into the new page. It works but to retrieve all the binary images takes quite a time. Is there any easier approach to achieve this? I've tried to use the Callback ID but it seems that a copied image gives a different ID so I can't just copy that.
I'm using Onenote 2013.
Regards,
ShiroYacha
There isn't a way to refer to the image that exists on another page when inserting an image to a page. What you are doing by copying the one:Image data is the only available approach for this.
Related
I have images stored in a SQL Server database with datatype image. I want to retrieve them and convert them to bitmap, and use them to create an asp.net web form image gallery for an online shopping web site.
Should I use <asp:Repeater> control, <asp:GridView> or data list control?
I don't want to use image path stored in the database
It's sad that the experts here are asking you questions as if you already know how to solve your problem which it is clear from your question you don't. Let me try and give you a little background and direction and I think you will be able to get closer to solving what you want to do.
Your images are just blobs in your sqlserver database which has no direct connection the web. The only way you can show images is you need to basically put them into an img tag with src= the location on your web server. What needs to happen is the location on the web server you choose must instead of reading a file from the file system of the server, must somehow grab the image from the database and then stream those image bytes to the img tag on the page.
THere are multiple ways to do that in asp.net. The easiest is a handler or ashx file (don't even know if those are supported anymore).
At anyrate, here is a link that might help. You might try googling something like "display image from sql server on asp.net" and see what else comes out. Obviously, lot's of people do this and you will to soon.
Good Luck.
https://www.aspsnippets.com/Articles/Display-image-from-database-in-Image-control-without-using-Generic-Handler-in-ASPNet.aspx
I have hundreds of PDF files that i need to present to users. When presenting these files through my MVC web app i don't want the users to have the ability to download the files, e.g.. i don't want the Acrobat reader controls for print/save showing up. Reading this stackoverflow post it seems that it's not possible to disable those controls.
I know users can still take screen shots and print out the page, but that's not an issue in my case.
What is the best way to go about this. I've reasearched using SWFTOOLS which looks like it may be a good solution, but i dont want to save the swf files to my filesystem. The optimal solution is PDF.js, but another problem i have is users will be accessing the files through IE8 - so PDF.js is out of the question. Unless there is another similar library that will convert the files to HTML 4.
Basically I just need to display the PDF files, on the fly would be best, in a different format than PDF
Any suggestions?
I had a similar project a while back, where sensitive pdfs were needed to be displayed to specific users but they weren't allowed to download/print/save it.
Since it was a web app I ended up using pdf.js. It is Mozilla's PDF renderer for firefox. It renders the pdf on to a canvas and by default has all the bells and whistles. If you have firefox, open a pdf file to see it in action.
It was tough to get it running at first but I ended up using a demo I found online as the base of the project. After removing each functionality that was forbidden the finished product did exactly what was required. You will need to add a print css file to block printing or find a better solution. I ended up using the css approach since print preview by passed my javascript check for the print action. Also ensure you block ctrl + s which allows the user to save the pdf.
Another aspect to note is that it works better on later versions of IE and struggles on older versions as the file size increases. Firefox and chrome are not a problem and I believe its the same for opera although I haven't tested that.
I would convert it to an image file, you can find tools or write script to do it, I personally would do it by displaying them in browser first and then use browser plug-ins to take screenshot of the entire webpage.
(you can automate this)
then just display then converted pdfs
**this is probably not the best solution :( **
I'm looking for the best way to display pdf document on a website. Surely I need to convert it to jpeg or gif for the browser to handle it. I read few posts but most refer to GhostScript and its pdf2image. But that solution calls for starting a process that would save a copy of pdf doc to the file system and then would have to be loaded back into memory for displaying. Frankly I find it a bit clumsy. For those of you who have done it, what library you used and if you could attach a link to some examples, I'd greatly appreciate it.
I'm developick a web application that helps manage manufacturing process and is accessed fron android tablets. Company has a stockpile of documentation in pdf files that is to be delivered to production managers. I'd love the solution to be akin Crystal Report Viewer contron but I I understand that I have to stick to pdf to image conversion. Please give me some advise here.
My advice is don't over think this.
You can simply add a link to the PDF file, which will open on a new tab.
You can take a look at http://mozilla.github.io/pdf.js/ which will allow you to render a PDF on the client side.
Or if you decide to go with a Ghostscript, you can take a look at http://ghostscriptnet.codeplex.com
By all accounts the PDF Focus .NET library seems to be the best solution. A wrd of advice is to add a cleanup method to the page unload to delete all temporary files that were used to feed source into image controls when displaying pictures on a website.
I am a making web app in Asp.net c# where i need to generate pdf,doc and ppt.
For PDF generation i have used Itext sharp and it works fine, now i need to create ppt and doc. I dont know from where to start.
I tried this http://www.dotnetspider.com/forum/157867-Create-power-point-slide-charts-using-c-net.aspx
but its not working
pls provide any usefull resource or any other way to do achieve this ?
Depending on what you need to do in with PowerPoint files, you may want to consider SoftArtisans PowerPointWriter features, which can populate a template with data and images. It has some built-in behavior to automatically copy slides, tables, and lists to handle different amounts of data.
In one of the other answers, the tutorial covered how to replace text, how to replace an image, how to copy a slide, and how to delete a slide. Here is some information on how to do this with PowerPointWriter for reference:
Importing text: Hello World with PowerPointWriter
Importing images: importing image reference, photo gallery code sample
Copy slide: Slides.CopySlide API reference, CopySlide code sample
Deleting slide: Slides.Delete API reference
Disclaimer: I work for SoftArtisans.
I am trying to figure out a way to programatically set an image on a Visual Studio Report where the image doesn't come from a file or from the database but from the running application.
My best guess is to somehow subvert the Embedded or Database Source types but I have been unable to figure out how to do this.
Do I really want to do this? Yes. The images are not in the database and can't be access via the file system for security reasons. I plan to Render the report directly to a PDF file stream to hopefully keep the memory footprint down.
Here is a revised solution:
You can save the image temporarily in the database after the user selects it from your app... in a table used for just that, clear out the table periodically, if you never really want to save this image. Then display in the report by passing the imageID for the table; based on what you said above it sounds like you know how to display an image saved in your database but if not I can give you a tutorial link.