2

My requirement is the ability to create a pdf file from a dynamic web-page (asp / c#). I need to have the ability to adjust the elements position (in the same way the one could use @media print to adjust the styling of the page and I cannot use anything that needs to be installed client-side.

Has anyone come across anything which can resolve this dilemma?

Edit: A lot of the solutions I am finding involve initiating code to place every element on the page (add.paragraph("blah") for example) but I need something which is more a snapshot of the page, but I can modify the positions of the elements and then save the pdf.

4
  • Use iTextsharp library. Commented Jul 24, 2013 at 9:36
  • I've updated my question to include more information. Commented Jul 24, 2013 at 9:41
  • You are the server. You want to create a PDF from what the client is rendering. Not possible. Commented Jul 24, 2013 at 9:48
  • Is there nothing that can be done that is similar to @media print. I could change the positions of the elements and then create a pdf file rather than print the page? Commented Jul 24, 2013 at 9:54

2 Answers 2

1

I have found the free (Affero GPL) iText library to be very useful. I have never used it from C# but it claims to be possible.

Edit: Client side PDF generation

Since as other commentators have pointed out what you wish to print is located on the client side rather than the server side. Perhaps you should look into JavaScript based PDF libraries. For example (but not limited to) this

Sign up to request clarification or add additional context in comments.

1 Comment

I've updated my question. Can this achieve what I am asking?
0

Migradoc One of possibilities.

2 Comments

I've updated my question. Can this achieve what I am asking?
No, and I think this is not possible to achieve what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.