当前位置: 首页 > news >正文

pdfjs库使用3

.App {

  text-align: center;

  height: 100vh;

  display: flex;

  flex-direction: column;

  background-color: #f5f5f5;

}

/* PDF 查看器容器样式 */

.pdf-viewer {

  flex: 1;

  padding: 20px;

  max-width: 100%;

  margin: 0 auto;

  box-sizing: border-box;

  background-color: white;

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

}

/* 控制按钮样式 */

.pdf-controls {

  padding: 10px;

  background-color: #fff;

  border-bottom: 1px solid #eee;

  position: sticky;

  top: 0;

  z-index: 100;

}

.pdf-controls button {

  padding: 8px 16px;

  margin: 0 10px;

  border: none;

  border-radius: 4px;

  background-color: #007bff;

  color: white;

  font-size: 14px;

  cursor: pointer;

  transition: background-color 0.2s;

}

.pdf-controls button:hover {

  background-color: #0056b3;

}

.pdf-controls button:disabled {

  background-color: #cccccc;

  cursor: not-allowed;

}

.pdf-controls span {

  font-size: 14px;

  color: #666;

}

/* PDF 内容容器样式 */

.pdf-container {

  margin-top: 20px;

  padding: 0 10px;

  overflow-y: auto;

  -webkit-overflow-scrolling: touch; /* 为 iOS 设备提供平滑滚动 */

}

/* Canvas 容器样式 */

canvas {

  max-width: 100%;

  height: auto;

  margin: 0 auto;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

}

/* 移动设备适配 */

@media screen and (max-width: 768px) {

  .pdf-viewer {

    padding: 10px;

  }

  .pdf-controls {

    padding: 8px;

  }

  .pdf-controls button {

    padding: 6px 12px;

    font-size: 12px;

  }

  .pdf-controls span {

    font-size: 12px;

  }

}

/* BlackBerry Access 浏览器特定优化 */

@supports (-webkit-touch-callout: none) {

  .pdf-container {

    /* 防止 iOS 设备上的橡皮筋效果 */

    overscroll-behavior: none;

  }

  /* 优化触摸响应 */

  .pdf-controls button {

    min-height: 44px; /* 确保触摸目标足够大 */

    touch-action: manipulation; /* 优化触摸事件 */

  }

}

/* 加载状态样式 */

.loading {

  display: flex;

  justify-content: center;

  align-items: center;

  height: 100px;

  color: #666;

}

/* 错误状态样式 */

.error {

  color: #dc3545;

  padding: 20px;

  text-align: center;

}

/* 页面计数器样式 */

.page-counter {

  margin: 0 15px;

  font-weight: 500;

}

/* 确保整个应用程序填充视口 */

html, body {

  margin: 0;

  padding: 0;

  height: 100%;

  width: 100%;

}

/* 滚动条样式优化 */

::-webkit-scrollbar {

  width: 8px;

  height: 8px;

}

::-webkit-scrollbar-track {

  background: #f1f1f1;

}

::-webkit-scrollbar-thumb {

  background: #888;

  border-radius: 4px;

}

::-webkit-scrollbar-thumb:hover {

  background: #555;

}

http://www.xdnf.cn/news/12421.html

相关文章:

  • Linux内核机制——内存管理
  • C++ 迭代器失效详解:如何避免 vector 操作中的陷阱
  • 数控铣床自动上下料机械手控制装置设计
  • IDEA 2025.1更新-AI助手试用和第三方模型集成方案
  • C++类和对象上
  • 00.IDEA 插件推荐清单(2025)
  • Jenkins 简易使用记录
  • 从零到一:管理系统设计新手如何快速上手?
  • MATLAB 控制系统设计与仿真 - 37
  • package.json 里面出现 workspace:*,关于工作区的解释
  • 极狐GitLab 账号限制有哪些?
  • 使用MetaGPT 创建智能体(2)多智能体
  • 抽象类和接口的区别
  • 基于X86/RK/全志+FPGA+AI工业一体机在电力接地系统中的应用方案
  • 【人力资源管理系统】C#实现
  • 国产品牌芯洲科技100V降压芯片系列
  • vscode 红色波浪线问题
  • YOLOv8 Bug 及解决方案汇总 【2024.1.24更新】【环境安装】【训练 断点续训】OMPError / KeyError
  • 深度学习3.1 线性回归
  • vcpkg缓存问题研究
  • volatile 和 memory barrier 的组合用法
  • xml+html 概述
  • React 事件处理基础
  • 简单好用的在线工具
  • Webpack基础
  • PHP8.2.9NTS版本使用composer报错,扩展找不到的问题处理
  • 清华大学李升波教授的强化学习Tutorial Lecture
  • 2D物体检测学习
  • Linux 系统编程 day4 进程管道
  • 多线程使用——多线程的创建和常用方法