Home Search Member List Faq Register Login  
UltimateEditor
Show header option when convert to PDF

Thread Starter: samoh   Started: 03-08-2010 11:02 AM   Replies: 9
 Karamasoft Support Forums » General Discussions » UltimateEditor » Show header option when convert to PDF
 Printable Version    « Previous Thread   Next Thread »
  08 Mar 2010, 11:02 AM
samoh is not online. Last active: 8/23/2010 8:38:36 AM samoh

Top 10 Posts
Joined on 03-08-2010
Posts 5
Show header option when convert to PDF
Hi,

I figured out that I can display header in odd/even pages, or hide header in the first page, when PDF is generated from the editor.

I just wonder whether there is any way to display header ONLY in the first page.

It is a requirement from our client, and hope there's a way around that I can implement.

Thanks.

  
  09 Mar 2010, 12:22 AM
Karamasoft is not online. Last active: 9/8/2010 11:48:21 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,334
Re: Show header option when convert to PDF
Please refer to HtmlToPdf.chm and HtmlToPdf_Manual.pdf documents under UltimateEditor\v3.6\Controls\Documents directory to learn more about how you can customize the PDF conversion process and see if it is possible to display the header only in the first page and let us know if you need any further assistance.
  
  09 Mar 2010, 7:06 AM
samoh is not online. Last active: 8/23/2010 8:38:36 AM samoh

Top 10 Posts
Joined on 03-08-2010
Posts 5
Re: Show header option when convert to PDF

I alreday looked at HtmlToPdf.chm and HtmlToPdf_Manual.pdf, so hope you do the same.

There are 3 built-in properties for showing headers, and I explained them in the previous post.

Or, here they are.

 ShowOnEvenPages : Show or not the header on even pages. By default the header is displayed both on odd and even pages.
 
 ShowOnFirstPage : When this property is true the header will be shown on the first page otherwise it will not be shown. This property has priority over ShowOnOddPages. The default value is true.
 
 ShowOnOddPages : Show or not the header on odd pages. By default the header is displayed both on odd and even pages. The ShowOnFirstPage property has priority over ShowOnOddPages.

I guess it needs to be done either in codebehind or in JavaScript.

I really wish you could come up with some solution.

Thanks.


  
  09 Mar 2010, 12:47 PM
Karamasoft is not online. Last active: 9/8/2010 11:48:21 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,334
Re: Show header option when convert to PDF
The ShowOnFirstPage property has a higher precedence over ShowOnOddPages property. Therefore, if you want to display the header only in the first page, you should set the show properties in your page's code-behind as follows:

htmlToPdf.PdfConverter.PdfHeaderOptions.ShowOnEvenPages = false;
htmlToPdf.PdfConverter.PdfHeaderOptions.ShowOnFirstPage = true;
htmlToPdf.PdfConverter.PdfHeaderOptions.ShowOnOddPages = false;

  
  10 Mar 2010, 7:10 AM
samoh is not online. Last active: 8/23/2010 8:38:36 AM samoh

Top 10 Posts
Joined on 03-08-2010
Posts 5
Re: Show header option when convert to PDF
Thank you.  What a smart way. I had to give more thoughts.

I have one more question, and hope you can provide help on this one, too.

We need to use mail merge to generate multiple instances of the same document for different customers. 

After each of the page break, we'll need to display headers in the same PDF document.

If the template goes to two pages, we might be able to use "ShowOnOddPages" option, but we cannot predict how many pages there will be.

I really wish you could find a solution, because this one seems to be the only issue so far, which keeps us from going further.

Thank you.

  
  10 Mar 2010, 1:02 PM
Karamasoft is not online. Last active: 9/8/2010 11:48:21 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,334
Re: Show header option when convert to PDF
We are not sure if we understand what exactly you're trying to achieve. In your previous post, we thought that you only wanted to show the header in the first page. Do you want to show the header in each page after the page break?
  
  11 Mar 2010, 7:23 AM
samoh is not online. Last active: 8/23/2010 8:38:36 AM samoh

Top 10 Posts
Joined on 03-08-2010
Posts 5
Re: Show header option when convert to PDF
Yes exactly.

The reason is, users want to generate letters for their customers in PDF form. In the PDF, there can be only one letter, or the same letters for multiple customers with their name and address.

One of the ways that I could think of was using Mail Merge in you UEmail control with UEditor control, because the customer info (name, address, ID, and etc) needs to be fetched from DB.  However, each of the letters need to have a header in the first page. 

That's why I thought about JavaScript or Code Behind solution, but I also wouldn't mind if I could merge PDF files, after generating single letter in each of the PDFs.

Thank you in advance.

  
  11 Mar 2010, 10:17 AM
Karamasoft is not online. Last active: 9/8/2010 11:48:21 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,334
Re: Show header option when convert to PDF
Is your header static or does it change dynamically depending on the page? If you want to show the same header in every single page, setting both ShowOnEvenPages and ShowOnOddPages to True should display the header. You can use the Mail Merge functionality provided by UltimateEmail control to dynamically generate the editor content from DB.
  
  11 Mar 2010, 11:26 AM
samoh is not online. Last active: 8/23/2010 8:38:36 AM samoh

Top 10 Posts
Joined on 03-08-2010
Posts 5
Re: Show header option when convert to PDF
Well, I think I didn't make myself clear enough on what I am trying to do.

Let me depict the file needs to be generated.

<PDF file Starts>
   <Letter1 Starts>
      <page1 with header>
      <page2 no header>
      <page3 no header>
   <Letter1 Ends>
   <Letter2 Starts>
      <page1 with header>
      <page2 no header>
      <page3 no header>
   <Letter2 Ends>
   <Letter3 Starts>
      <page1 with header>
      <page2 no header>
      <page3 no header>
   <Letter3 Ends>
         .
         .
         .
<PDF file Ends>

My question was about creating a PDF file shown above.

A letter can have one or any number of pages.  In using Mail Merge, I guess I need to insert page break at the end of each letters.

Headers will be the same, but needs to appear only on the first pages of each of the letters.

Very similar to the Mail Merge Demo, but with the header on the first page of each of the letters.

  
  11 Mar 2010, 5:15 PM
Karamasoft is not online. Last active: 9/8/2010 11:48:21 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 5,334
Re: Show header option when convert to PDF
Now we see what you are trying to achieve. Unfortunately, the PDF converter that the UltimateEditor is using does not offer the flexibility of showing header information based on individual page numbers, it only supports first page, odd or even page numbers. Sorry for the inconvenience.
  
 Page 1 of 1 (10 items)
Karamasoft Support Forums » General Discussions » UltimateEditor » Show header option when convert to PDF

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2010 Karamasoft LLC. All rights reserved.