Hi all I want to know about how to set pdf page settings to print properties dialog box?
For Example,
If my PDF page settings is Landscape then Layout automatically shows Landscape not Portrait. and If my PDF page settings is Protrait then Layout automatically shows Portrait.
I have make R&D lot on this topic but not found any satisfied link. Please give me satisfied answer. this will be very helpful to me.
PDF is a device-independent format and doesn't not include functionality to set print dialog parameters. JDF was designed to compliment PDF and contain process specific settings; however, it's not supported outside of large print workflows.
Related
I have a application where I have a pdf to show. I used AxAcroPDFLib. I can successfully show any pdf in that control. Now I want to get the current page of that pdf. There is no method like getCurrentPage in AxAcroPDFLib.
How to get that current page number. I searched it but did not find any solution for this.
You're not showing the code you currently are using, but your problem likely stems from the fact that you don't realize there is an additional layer present here. The document methods in the Adobe PDF library truly only deal with the PDF file itself and a PDF file doesn't have a current page number.
To display PDF documents, Acrobat uses an AVPageView. The AVPageView is your link for anything that concerns the display of your PDF files.
AVPageView has a method to get the currently visible page:
PDPageNumber AVPageViewGetPageNum(AVPageView pageView)
So from the document, get its page view and work with that to get the page number, zoom factor, display mode and so on.
I'm using iTextSharp to make PDF files. Specifically, the source of these PDF files is Outlook emails. So there are mailto:, website, etc links everywhere. These links don't show with an underline, they just link to a site when you hover over them and click. I looked at this question: Remove hyperlinks from a PDF document (iTextSharp) and tried both solutions, however neither removed the links. Can someone offer some advice on how to remove hyperlinks from a PDF USING iTextSharp?
I am using Adobe Acrobat Standard X.
Example: http://s000.tinyupload.com/?file_id=05714019267649134441
The solution was a preference in Acrobat/Reader. Go to Edit -> Preferences -> General tab -> Uncheck "Create links from URLs". The best part is, this setting will stay in effect while opening different documents. Credits to Chris Haas.
I'm working with a WinForms app. I have an RDLC report that will be printed on 11x17 and then folded (printer supports folding). I'm rendering to EMF and drawing to pages of a PrintDocument. This works fine except for folding.
What I'd like to do is store the settings that make the printer fold. The users would select a preset from a dropdown and the app would select the printer, the paper size, the tray, whether to duplex, and whether to fold. Storing the PrinterSettings object covers most of this, but doesn't save the folding option.
I first attempted to store/retrieve something I read about called DEVMODE. For reference: http://nicholas.piasecki.name/blog/2008/11/programmatically-selecting-complex-printer-options-in-c-shar/. What I found is that even though I had extra data specific to the driver, all the bytes were 0 regardless of what driver-specific settings I changed. I'm not sure where I went wrong with this, but I abandoned it and looked at the printing capabilities in WPF.
I found that I could configure a PrintTicket for my settings, store it, and retrieve it later. It seems a bit convoluted just to save the settings, but I think I have it working. At least it seems to show up correctly in the PrintDialog. However, I'm now stuck trying to figure out how to print my report.
As I understand it, I can't take a PrintDocument from WinForms printing and use it in WPF. I also read EMF format is not supported in WPF. I thought I would render each EMF to a bitmap, then print those. But the text in my report is fuzzy and I'm not having any luck clearing it up.
Starting with a stream that contains EMF bytes that I know will render sharply with PrintDocument, I test trying to save to a file. It seems no settings that I provide will save with crisp text.
var pageImage = new Metafile(stream);
pageImage.Save(filename);
All this just to add the ability to fold. Am I just completely on the wrong track? I don't see how this should be so hard. I guess I either need to find another way to save/restore custom printer settings or I need a way to render these EMF files better.
I also tried rendering the report directly to BMP format and it's also poor quality.
I tried something slightly different and it worked! I reused my original PrintDocument code and printed to an XPS file. Then I printed the XPS file using my PrintTicket and it works fine.
We are currently developing a Windows Forms application in VS 2008 C#. This application is for reading long (200 - 300 pages) law documents, and it handles about 30 - 40 docs. The application searches in document text, switches between documents, etc.
Our customer has sent the docs in separate *.rtf files for us to "put it into the application". We decided to convert the rtf files into HTML, using the MS Word's "Save as" function, and then selecting "filtered HTML". In this solution, the application can show the documents in a WebBrowser control.
Our problem is: the Customer wants an additional "Pager view" function, where the user can read the documents like it would be a book. He can see the pages on a virtual paper sheet, and then click next page, previous page, etc. Like in the browser's Print preview dialog.
I have searched the internet for any Pager HTML viewer, but I haven't found anything. Could you suggest any solution or component for showing the HTML pages in pager mode?
In last case, we can hold the original rtf files too for Pager View showing. In this case, is there any solution for view RichText files in pager mode? (We want to avoid it, if it's possible.)
Waiting for your answer:
Peter
I don't know of any components that can display HTML in pages, but a couple possible solutions could be:
edit the HTML documents and manually separate them into linked pages (or hidden divs with javascript to hide/unhide divs for navigating)
convert the RTF docs to XPS format and use WPF's DocumentViewer control - but since your app is WinForms, then you'd probably have to do something like this:
http://www.codeproject.com/KB/dialog/WinFormWPFIntegration.aspx
(though someone commented on that page about a memory-leak :S that's something to keep an eye open for...)
I am trying to implement a feature where i open (suppose in iframe) a PDF file (multiple pages), Highlight a section of the document a get the page number (the one that is displayed in the PDF tool bar).
Eg: if the toolbar display 2/7 which means i am right now in page 2, i need to capture the page number information. Sounds simple but i am not able to get a .dll/function that exposes this property.
Any help would be grateful.Thanks.
I wouldn't think this would be possible, there's no way to control PDFs with JavaScript in the browser, which is what you'd need to do.
This article suggests the same: http://codingforums.com/showthread.php?t=43436.
Content of link:
in short, no, you can't do that.
really don't think JS can read properties of PDFs, since PDFs are viewed in the browser thru a plugin, ie a viewport for another application (for want of a better explanation).
You may be better trying a different route, such as generating the pages as images and implementing your own paging. Depends on your content and requirements, of course. ABCPDF from http://www.websupergoo.com/ is free (with a link-back), not sure if that's any help for you.