|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
open web link in browserHi,
I am using iTextSharp and I love it. I use it to send pdf reports with html links. When users use Acrobat Reader the links are correctly opened inside the default web browser. When users use Acrobat (not Reader) it opens http links inside itself, acting as a web browser. This leads to a bad navigation and some incompatibility with ajax. Some clients are reporting this to happen with (at least) Adobe Acrobat 6.0 professional. No problem occurs if they explicitly open the link with right mouse button and select "Open Web Link in browser". But I can't tell everyone to change the way they open links, I need this "open link in browser" behavior by default. I was wondering if there's any anchor property to force acrobat to open link in browser, but I can't find any. My code is: Anchor a = new Anchor("Click here to open report"); a.Reference = "http://www.mysite.com/reports.aspx?id=" + reportId.ToString(); p = new Paragraph(); p.Add(a); Am I missing something? Thank you all in advance, Mdm. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: open web link in browserThat's an option in the viewer, there's nothing you can put in the PDF
to control it. Paulo > -----Original Message----- > From: itextsharp-questions-bounces@... > [mailto:itextsharp-questions-bounces@...] > On Behalf Of allmdm > Sent: Friday, June 27, 2008 12:31 PM > To: itextsharp-questions@... > Subject: [itextsharp-questions] open web link in browser > > Hi, > I am using iTextSharp and I love it. > I use it to send pdf reports with html links. > When users use Acrobat Reader the links are correctly opened > inside the > default web browser. > When users use Acrobat (not Reader) it opens http links inside itself, > acting as a web browser. > This leads to a bad navigation and some incompatibility with ajax. > Some clients are reporting this to happen with (at least) > Adobe Acrobat 6.0 > professional. > > No problem occurs if they explicitly open the link with right > mouse button > and select "Open Web Link in browser". But I can't tell > everyone to change > the way they open links, I need this "open link in browser" > behavior by > default. > > I was wondering if there's any anchor property to force > acrobat to open link > in browser, but I can't find any. > > My code is: > > Anchor a = new Anchor("Click here to open report"); > a.Reference = "http://www.mysite.com/reports.aspx?id=" + > reportId.ToString(); > p = new Paragraph(); > p.Add(a); > > Am I missing something? > > Thank you all in advance, > Mdm. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: open web link in browserYou could use pushbutton instead of Anchor to get rid of the problem. You need to attach a action to the button and in the action, you need to use launchURL function, which will ensure the link is open in the web browser.
Bob
|
|
|
Re: open web link in browserHello,
I have a link "PDF" in my web page and when it is clicked, I will generate the content of document dinamically. I want that the file pdf appears in the page, with the button for save a disc if the user wants. The examples that i have seen are in main, but no in the aspx. Can you say me how to do it? Many thanks for your help. C. |
|
|
Re: open web link in browserI do it with an iframe. For example:
<iframe id="PDFLINK" name="PDFLINK" style="width: 770px; height: 770px;" runat="server" visible="false" ></iframe> Then in the code behind I have something like this: PDFLINK.Attributes("src") = oReport.DocumentURL PDFLINK.Visible = True where oReport is a class that creates the pdf document in a temporary location with a GUID filename and DocumentURL is the URL for that temporary location and filename. -Joe On Wed, Jul 9, 2008 at 6:51 AM, camino8 <aonarres@...> wrote: > > Hello, > > I have a link "PDF" in my web page and when it is clicked, I will generate > the content of document dinamically. I want that the file pdf appears in the > page, with the button for save a disc if the user wants. > > The examples that i have seen are in main, but no in the aspx. > > Can you say me how to do it? > > Many thanks for your help. > > C. > > -- > View this message in context: http://www.nabble.com/open-web-link-in-browser-tp18153196p18358844.html > Sent from the itextsharp-questions mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > itextsharp-questions mailing list > itextsharp-questions@... > https://lists.sourceforge.net/lists/listinfo/itextsharp-questions > > -- http://www.jlion.com ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
error in pdfwrite.getinstanceHello,
I use: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; using iTextSharp.text; using iTextSharp.text.pdf; public partial class analisis_informe_pdf : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // step 1 // need to write to memory first due to IE wanting // to know the length of the pdf beforehand MemoryStream m = new MemoryStream(); Document document = new Document(); try { // step 2: we set the ContentType and create an instance of the Writer Response.ContentType = "application/pdf"; PdfWriter.getInstance(document, m); // step 3 document.Open(); // step 4 document.Add(new Paragraph(DateTime.Now.ToString())); } catch (DocumentException ex) { Console.Error.WriteLine(ex.StackTrace); Console.Error.WriteLine(ex.Message); } // step 5: Close document document.Close(); // step 6: Write pdf bytes to outputstream Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length); } } but this produces the error: CS0117: 'iTextSharp.text.pdf.PdfWriter' does not contain a definition for 'getInstance' Can you help me? Thanks Regards. |
|
|
Re: error in pdfwrite.getinstanceIt's GetInstance(). CTRL-SPACE doesn't auto complete/correct the method
name or are you using notepad for development? Paulo > -----Original Message----- > From: itextsharp-questions-bounces@... > [mailto:itextsharp-questions-bounces@...] > On Behalf Of camino8 > Sent: Friday, July 11, 2008 9:53 AM > To: itextsharp-questions@... > Subject: [itextsharp-questions] error in pdfwrite.getinstance > > > Hello, > I use: > > using System; > using System.Collections; > using System.ComponentModel; > using System.Data; > using System.Drawing; > using System.Web; > using System.Web.SessionState; > using System.Web.UI; > using System.Web.UI.WebControls; > using System.Web.UI.HtmlControls; > using System.IO; > > using iTextSharp.text; > using iTextSharp.text.pdf; > > public partial class analisis_informe_pdf : System.Web.UI.Page > { > protected void Page_Load(object sender, EventArgs e) > { > > // step 1 > // need to write to memory first due to IE wanting > // to know the length of the pdf beforehand > MemoryStream m = new MemoryStream(); > Document document = new Document(); > try > { > // step 2: we set the ContentType and create an > instance of the > Writer > Response.ContentType = "application/pdf"; > PdfWriter.getInstance(document, m); > > // step 3 > document.Open(); > > // step 4 > document.Add(new Paragraph(DateTime.Now.ToString())); > > } > catch (DocumentException ex) > { > Console.Error.WriteLine(ex.StackTrace); > Console.Error.WriteLine(ex.Message); > } > // step 5: Close document > document.Close(); > > // step 6: Write pdf bytes to outputstream > Response.OutputStream.Write(m.GetBuffer(), 0, > m.GetBuffer().Length); > } > } > but this produces the error: > > CS0117: 'iTextSharp.text.pdf.PdfWriter' does not contain a > definition for > 'getInstance' > > Can you help me? > > Thanks > > Regards. Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: error in pdfwrite.getinstanceuff, thanks for your help. I didn't see it.
Now, when execute this page, appears: %PDF-1.4 %���� 2 0 obj <>stream x�+�r �26S�00SI�2P�5�1�� �BҸ4 M���� ,�"V�fV�!Y@� ��!\�\�% endstream endobj 4 0 obj<>/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]>>/Parent 3 0 R/MediaBox[0 0 595 842]/Contents 2 0 R/Type/Page>> endobj 1 0 obj<> endobj 3 0 obj<> endobj 5 0 obj<> endobj 6 0 obj<> endobj xref 0 7 0000000000 65535 f 0000000308 00000 n 0000000015 00000 n 0000000395 00000 n 0000000152 00000 n 0000000445 00000 n 0000000489 00000 n trailer <<380fa8324e25f174f196705882ac303d>]>> startxref 632 %%EOF How can i open the pdf in navegator, with options bar (save, ...). Is this? Is it necessary save temporaly the document in disk? Many thanks for your help. C. |
|
|
Re: error in pdfwrite.getinstanceThere is really nothing you can do at the server to *control* what happens to the PDF at the browser.
However, adding Content-Type and Content-Disposition headers might help: Response.AddHeader("Content-Disposition","inline;filename=temp.pdf"); Response.ContentType = "application/pdf" On Mon, Jul 14, 2008 at 6:18 AM, camino8 <aonarres@...> wrote:
------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ itextsharp-questions mailing list itextsharp-questions@... https://lists.sourceforge.net/lists/listinfo/itextsharp-questions |
|
|
Re: error in pdfwrite.getinstanceThank you very much for your help. Finally it works.
I do not understand like in the examples that I have found it does not come quite. Regards. |
| Free Forum Powered by Nabble | Forum Help |