HtmlSaveOptions

HtmlSaveOptions

Descripción general

HtmlSaveOptions es una clase en Aspose.PDF FOSS para .NET.
Hereda de: UnifiedSaveOptions.

Opciones para guardar un documento PDF como HTML.

Esta clase proporciona 4 métodos para trabajar con objetos HtmlSaveOptions en programas .NET.
Los métodos disponibles incluyen: HtmlSaveOptions.
Todos los miembros públicos son accesibles para cualquier aplicación .NET después de instalar el paquete Aspose.PDF FOSS for .NET.
Propiedades: AdditionalMarginWidthInPoints, ApsIntermediateFileIfAny, BatchSize, CacheGlyphs, CloseResponse, CompressSvgGraphicsIfAny, y 27 más.

Propiedades

NombreTipoAccesoDescripción
AdditionalMarginWidthInPointsintLectura/EscrituraAncho extra (puntos PDF) añadido al margen derecho de cada página en el HTML de salida.
BatchSizeintLectura/EscrituraCuántas páginas PDF se procesan por lote de salida cuando SplitIntoPages está activo.
CompressSvgGraphicsIfAnyboolLectura/EscrituraComprimir gráficos SVG si están presentes.
ConvertMarkedContentToLayersboolLectura/EscrituraConvertir secciones de contenido marcado a capas HTML.
DefaultFontNamestringLectura/EscrituraNombre de fuente predeterminado usado cuando un glifo no tiene una cara resoluble.
DocumentTypeHtmlDocumentTypeLectura/EscrituraTipo de documento HTML emitido por el escritor.
ExplicitListOfSavedPagesint[]Lectura/EscrituraNúmeros de página basados en 1 para renderizar.
FixedLayoutboolLectura/EscrituraUsar diseño fijo (absoluto) al emitir posiciones de texto.
FlowLayoutParagraphFullWidthboolLectura/EscrituraHacer que los párrafos de flujo ocupen todo el ancho de la página.
FontSourcesAspose.Pdf.Text.FontSourceCollectionLecturaFuentes de tipografía consultadas al incrustar fuentes en la salida HTML.
IgnoreResourceFontErrorsboolLectura/EscrituraSuprimir errores de recursos de fuentes durante la conversión y sustituir.
IgnoredTextFontSizeSystem.Nullable<float>Lectura/EscrituraGlifos cuyo tamaño de fuente es igual o inferior a este valor se omiten de la salida.
ImageResolutionintLectura/EscrituraDPI usado al rasterizar contenido vectorial o de fuentes.
MinimalLineWidthfloatLectura/EscrituraAncho mínimo de trazo por debajo del cual las líneas se ensanchan.
PreventGlyphsGroupingboolLectura/EscrituraSi es verdadero, los glifos se emiten individualmente en lugar de agruparse en secuencias.
RenderTextAsImageboolLectura/EscrituraRenderizar fragmentos de texto como imágenes rasterizadas en lugar de texto seleccionable.
SaveFullFontboolLectura/EscrituraIncrustar tablas de fuentes completas en lugar de subconjuntos.
SimpleTextboxModeGroupingboolLectura/EscrituraAgrupar glifos adyacentes en un solo cuadro de texto para un DOM más limpio.
SplitCssIntoPagesboolLectura/EscrituraCuando SplitIntoPages es verdadero, también dividir el CSS por página.
SplitIntoPagesboolLectura/EscrituraEmitir un archivo HTML por página en lugar de un único documento concatenado.
TitlestringLectura/EscrituraElementode HTML.</td> </tr> <tr> <td><code>PngIntermediateFileIfAny</code></td> <td><code>string</code></td> <td>Lectura/Escritura</td> <td>Ruta a un archivo PNG intermedio (artefacto de depuración, paridad con HtmlLoadOptions.ApsIntermediateFileIfAny / XpsIntermediateFileIfAny).</td> </tr> <tr> <td><code>XpsIntermediateFileIfAny</code></td> <td><code>string</code></td> <td>Lectura/Escritura</td> <td>Ruta a un archivo XPS intermedio (artefacto de depuración).</td> </tr> <tr> <td><code>ApsIntermediateFileIfAny</code></td> <td><code>string</code></td> <td>Lectura/Escritura</td> <td>Ruta a un archivo APS intermedio (artefacto de depuración).</td> </tr> <tr> <td><code>TryMergeFragments</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Fusionar fragmentos de texto adyacentes en una sola secuencia cuando sea posible.</td> </tr> <tr> <td><code>UseZOrder</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Respetar el orden Z del contenido superpuesto al emitir HTML.</td> </tr> <tr> <td><code>ExtractOcrSublayerOnly</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Obtiene o establece solo la subcapa de extracción OCR.</td> </tr> <tr> <td><code>CloseResponse</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Obtiene o establece la respuesta de cierre.</td> </tr> <tr> <td><code>SaveFullPath</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Obtiene o establece la ruta completa de guardado.</td> </tr> <tr> <td><code>WarningHandler</code></td> <td><code>IWarningCallback</code></td> <td>Lectura/Escritura</td> <td>Manejador de advertencias invocado durante la serialización.</td> </tr> <tr> <td><code>WarningHandlerName</code></td> <td><code>string</code></td> <td>Lectura/Escritura</td> <td>Gancho de manejador de advertencias de tipo cadena heredado.</td> </tr> <tr> <td><code>CacheGlyphs</code></td> <td><code>bool</code></td> <td>Lectura/Escritura</td> <td>Precargar glifos rasterizados para acelerar la emisión repetida de texto.</td> </tr> <tr> <td><code>SaveFormat</code></td> <td><code>SaveFormat</code></td> <td>Lectura</td> <td>El formato de guardado que configura esta instancia de opciones.</td> </tr> </tbody> </table> <h2>Métodos<span class="hx-absolute -hx-mt-20" id="métodos"></span> <a href="#m%c3%a9todos" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><table> <thead> <tr> <th>Signature</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>HtmlSaveOptions()</code></td> <td>Llama a HtmlSaveOptions en esta instancia de HtmlSaveOptions.</td> </tr> <tr> <td><code>HtmlSaveOptions(fixedLayout: bool)</code></td> <td>Llama a HtmlSaveOptions(fixedLayout) en esta instancia de HtmlSaveOptions.</td> </tr> <tr> <td><code>HtmlSaveOptions(documentType: HtmlDocumentType)</code></td> <td>Llama a HtmlSaveOptions(documentType) en esta instancia de HtmlSaveOptions.</td> </tr> <tr> <td><code>HtmlSaveOptions(documentType: HtmlDocumentType, fixedLayout: bool)</code></td> <td>Llama a HtmlSaveOptions(documentType, fixedLayout) en esta instancia de HtmlSaveOptions.</td> </tr> </tbody> </table> <h2>Ver también<span class="hx-absolute -hx-mt-20" id="ver-también"></span> <a href="#ver-tambi%c3%a9n" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><ul> <li><a href="https://reference.aspose.com/pdf/net/" target="_blank" rel="noopener">Aspose.PDF for .NET — Referencia de API empresarial</a></li> </ul> </div> <div class="hx-mt-16"></div> </main> </article> </div> <script defer src="/js/main.min.d0f0346255ba9418db8fcf7f9440ca4e532e06276d8df17497e19e1045ee360b.js" integrity="sha256-0PA0YlW6lBjbj89/lEDKTlMuBidtjfF0l+GeEEXuNgs="></script> <script defer src="/lib/flexsearch/flexsearch.bundle.min.e45e7eb129aae9f684e7f863bb7c1d612ea124b7068e12af80c58c62764a5379.js" integrity="sha256-5F5+sSmq6faE5/hju3wdYS6hJLcGjhKvgMWMYnZKU3k="></script> <script defer src="/es.search.min.37da143a94b229dad1b7988831275f4fb101f62cf08958c1c81a43e1a155e56c.js" integrity="sha256-N9oUOpSyKdrRt5iIMSdfT7EB9izwiVjByBpD4aFV5Ww="></script> <script> (function(i, s, o, g, r, a, m) { i['ContainerizeMenuObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.append(a) })(window, document, 'script', 'https://menucdn.containerize.com/core/engine.min.js?v=1.0.1', 'asposeorg-en'); </script> <div class="lang-selector" id="locale" style="display:none!important"> <a href="#"> <em class=" flag-24"></em> Español</a> </div> <div class="modal fade lanpopup" id="langModal" tabindex="-1" aria-labelledby="langModalLabel" data-nosnippet="" aria-modal="true" role="dialog" style="display:none"> <div class="modal-dialog modal-dialog-centered modal-lg"> <div class="modal-content" style="background-color: #343a40"> <a class="lang-close" id="lang-close"> <img src="/close.svg" width="14" height="14" alt="Close"> </em> </a> <div class="modal-body"> <div class="rowbox"><div class="col langbox"> <a href="https://reference.aspose.org/pdf/net/htmlsaveoptions/" data-title="En" class="langmenu"> <span> <em class=" flag-24"></em> English </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/ar/pdf/net/htmlsaveoptions/" data-title="Ar" class="langmenu"> <span> <em class=" flag-24"></em> العربية </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/bg/pdf/net/htmlsaveoptions/" data-title="Bg" class="langmenu"> <span> <em class=" flag-24"></em> Български </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/ca/pdf/net/htmlsaveoptions/" data-title="Ca" class="langmenu"> <span> <em class=" flag-24"></em> Català </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/de/pdf/net/htmlsaveoptions/" data-title="De" class="langmenu"> <span> <em class=" flag-24"></em> Deutsch </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/el/pdf/net/htmlsaveoptions/" data-title="El" class="langmenu"> <span> <em class=" flag-24"></em> Ελληνικά </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/fa/pdf/net/htmlsaveoptions/" data-title="Fa" class="langmenu"> <span> <em class=" flag-24"></em> فارسی </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/fi/pdf/net/htmlsaveoptions/" data-title="Fi" class="langmenu"> <span> <em class=" flag-24"></em> Suomi </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/fr/pdf/net/htmlsaveoptions/" data-title="Fr" class="langmenu"> <span> <em class=" flag-24"></em> Français </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/he/pdf/net/htmlsaveoptions/" data-title="He" class="langmenu"> <span> <em class=" flag-24"></em> עברית </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/hr/pdf/net/htmlsaveoptions/" data-title="Hr" class="langmenu"> <span> <em class=" flag-24"></em> Hrvatski </span> </a> </div><div class="col langbox"> <a href="https://reference.aspose.org/pt/pdf/net/htmlsaveoptions/" data-title="Pt" class="langmenu"> <span> <em class=" flag-24"></em> Português </span> </a> </div></div> </div> </div> </div> </div> <script defer> const langshowpop = document.getElementById('locale'); const langhidepop = document.getElementById('lang-close'); langshowpop.addEventListener('click', addClass, false); langhidepop.addEventListener('click', removeClass, false); function addClass() { var langshow = document.querySelector('.lanpopup'); langshow.classList.toggle('show'); } function removeClass() { var langclose = document.querySelector('.lanpopup'); langclose.classList.remove('show'); } </script> <script defer> const observer = new MutationObserver((mutations, obs) => { const parent = document.getElementById('DynabicMenuUserControls'); if (parent) { const child = document.getElementById('locale'); parent.prepend(child); child.setAttribute("id", "localswitch"); child.setAttribute('style', 'visibility:visible'); obs.disconnect(); return; } }); observer.observe(document, { childList: true, subtree: true }); </script> <style> .modal { position: fixed; top: 0; left: 0; z-index: 1049; display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; } .modal-dialog { position: relative; width: auto; margin: 0.5rem; pointer-events: none; } .modal.fade .modal-dialog { transition: transform 0.3s ease-out; transform: translate(0, -50px); } @media (prefers-reduced-motion: reduce) { .modal.fade .modal-dialog { transition: none; } } .modal.show .modal-dialog { transform: none; } .modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 1rem); } .modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 0.3rem; outline: 0; } .modal-body { position: relative; flex: 1 1 auto; padding: 1rem; } @media (min-width: 576px) { .modal-dialog { max-width: 500px; margin: 1.75rem auto; } .modal-dialog-centered { min-height: calc(100% - 3.5rem); } } @media (min-width: 992px) { .modal-lg { max-width: 800px; } } #langModal a { text-decoration: none !important; } #langModal a:focus, #langModal a:visited, #langModal a:hover { text-decoration: none !important; } .langbox { margin: 0; width: 20% !important; flex: none; } #langModal a { color: #fff; font-size: 14px !important; padding: 10px 0; display: block; } #langModal { display: none; } #langModal.show { display: block !important; opacity: 1; } .rowbox { display: flex; align-items: center; justify-content: center; flex-flow: wrap; } .lanpopup.show:before { content: ""; position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: #0009; } .lang-close { position: absolute; z-index: 999999; color: #fff; background: #dc4342 !important; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 100%; padding: 0; text-align: center; line-height: 21px; cursor: pointer; display: flex; align-items: center; justify-content: center; } .lang-close img { display: none; } .lang-close:before { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 2px; background: #fff; transform: rotate(-45deg); margin: 11px 6px; } .lang-close:after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 2px; background: #fff; transform: rotate(45deg); margin: 11px 6px; } .lang-close img { width: 14px; height: 14px; filter: invert(1); } .lang-close:hover { transform: scale(1.1); } .col.langbox { flex-grow: inherit; flex-basis: inherit; } @media (max-width: 768px) { .langbox { width: 30% !important; text-align: left; } } .langbox span { display: flex; align-items: center; } .lang-selector:hover > a, .topsearchbtn:hover img, .userlogin:hover img { filter: none !important; color: #3ca3d9 !important; } body .lang-selector:hover { background-color: transparent !important; } @media (max-width: 768px) { .lang-close { right: 0 !important; } .lang-selector a { font-size: 0; } body .lang-selector { min-width: 35px !important; margin: 0 !important; width: 35px !important; } } body .lang-selector#localswitch a { color: #ffffff; cursor: pointer; } .subscibe-rhs #subscribe_fields input { min-height: 50px !important; max-width: 60% !important; } @media (max-width: 992px) and (min-width: 0px) { .subscibe-rhs #subscribe_fields input { max-width: 100% !important; width: 100% !important; margin: 0 !important; } } @media (max-width: 668px) { body .lang-selector#localswitch a { font-size: 0 !important; } body div#DynabicMenuInnerDiv .venturelogo a { background-size: 150px !important; width: 150px !important; background-position: center !important; margin-top: 0 !important; min-height: 60px !important; } } body .lang-selector#localswitch a { font-size: 14px !important; } body .lang-selector { min-width: inherit !important; width: inherit !important; max-width: inherit !important; white-space: nowrap; margin-right: 5px !important; } .langbox span { text-align: center !important; display: block; } .langbox a:hover { color: #ffffff !important; background: #222222; } .flag-24:before, .flag-24:after { display: none !important; } .lang-selector .flag-24 { width: 18px; height: 18px; background: url(https://www.documentprocessing.com/images/common/globe-ico.png) transparent 0 0; background-size: cover; display: block !important; } </style> <script defer> const localizedSubdomains = ["products.aspose.org", "kb.aspose.org", "docs.aspose.org", "reference.aspose.org", "blog.aspose.org", "www.aspose.org", "about.aspose.org", "websites.aspose.org"]; const familyBasedLocalization = []; const productFamilies = ["3d", "barcode", "cad", "cells", "diagram", "drawing", "email", "finance", "font", "gis", "html", "imaging", "medical", "note", "ocr", "omr", "page", "pdf", "psd", "pub", "slides", "svg", "tasks", "tex", "words", "zip"]; const knownLangCodes = ["ar", "az", "bg", "bn", "cs", "de", "el", "es", "et", "fa", "fi", "fr", "ga", "he", "hi", "hr", "hu", "hy", "id", "it", "ja", "jv", "ka", "ko", "lt", "lv", "ms", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "th", "tr", "uk", "vi", "zh"]; function getLanguageFromHtml() { return document.documentElement.lang || 'en'; } function applyTranslations(translations) { document.querySelectorAll('[data-i18n]').forEach(element => { const key = element.getAttribute('data-i18n'); if (key && translations[key]) { element.textContent = translations[key]; } }); } function updateLocalizedLinks() { const currentLang = getLanguageFromHtml(); const langPath = currentLang === 'en' ? '' : `/${currentLang}`; document.querySelectorAll('[data-localize]').forEach(element => { let originalUrl = new URL(element.getAttribute('href'), window.location.origin); let baseUrl = originalUrl.hostname; let path = originalUrl.pathname.replace(/\/$/, ''); if (!baseUrl) return; const pathSegments = path.split('/').filter(Boolean); const firstSegment = pathSegments[0] || ''; const hasExistingLang = knownLangCodes.includes(firstSegment); if (localizedSubdomains.includes(baseUrl)) { element.href = hasExistingLang ? `https://${baseUrl}${path}` : `https://${baseUrl}${langPath}${path}/`; } else if (familyBasedLocalization.includes(baseUrl)) { let family = pathSegments[0]; if (productFamilies.includes(family)) { element.href = hasExistingLang ? `https://${baseUrl}${path}` : `https://${baseUrl}/${family}${langPath}/`; } else { element.href = hasExistingLang ? `https://${baseUrl}${path}` : `https://${baseUrl}${langPath}/`; } } }); } function loadTranslations(lang) { fetch(`/translations/${lang}.json`) .then(response => { if (!response.ok) { throw new Error(`Failed to fetch ${lang}.json`); } return response.json(); }) .then(translations => { applyTranslations(translations); updateLocalizedLinks(); }) .catch(error => { console.error(`Error loading ${lang} translations:`, error); }); } function ensureMenuLoaded(callback) { const menu = document.querySelector('.menuitems'); if (menu) { callback(); } else { setTimeout(() => ensureMenuLoaded(callback), 100); } } function handleLanguageChange() { setTimeout(() => { const newLang = getLanguageFromHtml(); loadTranslations(newLang); }, 500); } document.addEventListener('DOMContentLoaded', () => { const currentLang = getLanguageFromHtml(); ensureMenuLoaded(() => { loadTranslations(currentLang); }); const langSwitcher = document.querySelector('#locale, #langModal, .langmenu'); if (langSwitcher) { langSwitcher.addEventListener('click', handleLanguageChange); } const observer = new MutationObserver(() => handleLanguageChange()); observer.observe(document.documentElement, { attributes: true, attributeFilter: ['lang'] }); }); </script> </body> </html>