Is there a way not to repeat a Migradoc header on every single page?
In my program I add an image to the header of my document as:
Section section = document.AddSection();
// Put a logo in the header
Image image = section.Headers.Primary.AddImage(#"C:\img\SmallLogo.png");
I would like the image to only appear on the first page of my document. However when the document spans multiple pages the image is added at the top of every single page.
How can I only add the image to the first page?
Header and Footer will be repeated on all pages of the section. It's a feature, not a bug.
To have the image only on the first page, you can use a "workaround" by setting a different header for the first page.
But IMHO the cleanest solution would be adding the image to the first page and not the header. This way it will only show once - on the first page where you want to have it.
BTW: Images are shapes and can be positioned anywhere on the page.
Related
HELP ME please.
When I create a new section within the portfolio part of my Squarespace website, it is greyed out. See link below. I can still add content to the section. As you can see there is a 'BACK' button and variations of background with either an image or plain colour. But why is there a white/grey overlay on the section?
If I move the section up then the image gallery comes down into the second position, and has the grey overlay. So it seems it's the second section position which has the problem. If I create another section below the second one it's completely fine as well.
I hope this is an easy one to fix.
thanks! 🙂
https://www.regardsfromyourfuture.com/future-paintings/project-one-44zcm-57lgb-6glfy-p2f7c-nbdk9-76lc2-zh5z9
That is happening due to the following rule that is within your Custom CSS / CSS Editor:
.page-section:nth-child(2) {
background: #000 !important;
filter: opacity(30%);
}
That rule was likely written specifically for a different page, but was not written such that it only applies to said page. You'll want to examine your other pages to see if any page is benefiting from that rule, whereby the second section of the page has a lower opacity. If I were to guess, I'd say it's a section on a page that only has a background image with no content.
If there is no other page that benefits from the rule, you can simply delete it from your CSS.
On the other hand, if there is a page (or set of pages) that benefits from the rule, you would want to edit the rule so that it is specific to a single page (or set of pages) by adding the collection ID classes to the beginning of the rule.
I'm using Vala for Webkit (webkit2gtk-4.0) to display HTML content on WebView. Instead of showing the vertical scrollbars, I would like to break up the page into a smalled set of lines i.e. pagination. the attached picture will give an idea of the content i'm displaying.
Is there someway I can identify the number of lines when the content reaches the max page size and break up the content into the next page and so on. Is there a signal I can connect to which will help me do pagination. Here is the link to my code on GitHub: bookworm
The content has its own stylesheets and also images, so I cannot think of characters per line and no of lines per page to do the pagination.
Thanks in advance for any ideas.
My website has very few images: 2 versions of the logo, a favicon, and a default user image. They are used on many pages. These images are also referenced from a /publicrelations page.
The website also has an animated image that is only in the background of the landing page, but I don't want this indexed.
When creating the image sitemap, should I
A: only do <url><loc>myurl.com/publicrelations</loc>infoAboutAllTheCommonImages</url>
B: do what is in "A" but for every page (i.e. <loc>urlToSomePage</loc>), even though every page will reference the same images
C: something else?
Thank you
The essence of including an image sitemap is for your image to be visible on the search engine results page. Question is- do you want your favicon and logo on the search results? If NO, forget about the sitemap.
If YES, there's no need to include the same image from every page. It's not relevant to the search results to have identical images. Just choose one.
I'm generating PDF by adding single PdfPTable which accommodates multiple pages.
Now I want to add header and footer to all these pages but it is only displaying on first page. Also margins are not working correctly.
I am overriding OnStartPage/OnEndPage events of class PdfPageEventHelper.
Kindly suggest best way to incorporate header and footers.
Thanks
Rule #1: don't use OnStartPage() to add a header or a footer. Use the OnEndPage() method only to add both the header and the footer.
Rule #2: don't add content to the Document object passed as a parameter to the event method. Use the DirectContent of the PdfWriter instead.
Rule #3: read the documentation and look at the examples and Q&As marked header and footer
You'll notice that your question is a duplicate of:
How to add HTML headers and footers to a page? (Java example)
How to generate a report with dynamic header in PDF using itextsharp? (C# example)
How to add text as a header or footer?
...
This answers your question: Kindly suggest best way to incorporate header and footers.
Your question about "margins not working correctly" is probably answered here: Why is my content overlapping with my footer? However, saying "margins are not working correctly" isn't an actual question. If I tell my doctor: "I don't feel well, please help me!" I can't expect him to help me if I don't give him more info. When I add headers and footers, the margins work correctly. If it doesn't work for you, you are doing it wrong...
The same is true for your allegation that the header and footer "is only displaying on first page." That's simply not true from our point of view. If you add the event to a PdfWriter like this:
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filename));
Header event = new Header();
writer.setPageEvent(event);
Then the OnEndPage() method is invoked every time a page is finalized.
Is there a way to show the report header only on the first page? Just as expected the PageHeader.PrintOnFirstPage only shows or hides the header for the first page only. The customer wants the header to show up only on the first page, kinda like a title in a document. I looked at MS-RDL.pdf and RDL200501 with no luck. My reports are RDLC not RDL but it should not matter. If there is no straightforward solution I will look into writing custom code to supress the header on pages > 1.
If you need the header to be on the first page only, why struggle to put it inside the PageHeader anyway?
Instead, remove the PageHeader altogether and design whatever you want as the 'header' directly at the top most body.
Just my two cents.